Page 1 of 1

How to simulate internet issues on a wifi interface?

Posted: Fri Dec 20, 2013 1:57 pm
by soulreaver1
I have a RB751G-2HnD with the deafult configuration (I've just changed network to 192.168.1.0). I'm a mobile app developer and I need to test my app in the following scenario:

1. connect device to the wifi network (with the internet).
2. simulate internet interruption (lack of the internet but the device must stay connected to the wifi network). This change need to be on the fly.
3. after few seconds the internet need to be active again.

Is there any way in the Mikrotik OS to switch the internet on/off "on the fly" but only for the wifi interface?

Re: How to simulate internet issues on a wifi interface?

Posted: Fri Dec 20, 2013 3:05 pm
by nerdtron
Many ways, if the device is just connected via wifi, just unplug the internet connection and the see what happens. The device is still connected to the wifi but no internet connection. Then plug the internet connection again.

Another option would be to disable/enable the nat rules. Open up winbox and go to IP>Firewall>NAT, disable the rules temporarily and anything connected will lose internet connection. Then enable it again.

Re: How to simulate internet issues on a wifi interface?

Posted: Mon Dec 23, 2013 10:54 am
by soulreaver1
Ok, but it needs to be done only for the wifi interface. Ethernet interface must stay connected to the interent.

Re: How to simulate internet issues on a wifi interface?

Posted: Mon Dec 23, 2013 4:35 pm
by nerdtron
Does your wifi has the same IP block as your LAN?
Make specific NAT rules, let's say your lan start at 192.168.1.2-50, then wifi IPs are 192.168.51-254, then created a NAT rule that will only NAT LAN IPs. Define the scr-address-list in address lists.

Or if your testing wifi from a single IP (say you wifi pc has an ip of 192.168.1.15), you can exempt it in NAT translations.
/ip firewall nat
add chain=srcnat out-interface=WAN1 action=masquerade src-address=!192.168.1.15

OR you can block the IP from being forwarded
/ip firewall filter add chain=forward src-address=192.168.1.15 action=drop