Community discussions

MikroTik App
 
soulreaver1
just joined
Topic Author
Posts: 22
Joined: Tue May 11, 2010 12:19 pm
Location: Warsaw, Poland

How to simulate internet issues on a wifi interface?

Fri Dec 20, 2013 1:57 pm

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?
 
nerdtron
Member Candidate
Member Candidate
Posts: 123
Joined: Sat Nov 30, 2013 7:49 am

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

Fri Dec 20, 2013 3:05 pm

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.
 
soulreaver1
just joined
Topic Author
Posts: 22
Joined: Tue May 11, 2010 12:19 pm
Location: Warsaw, Poland

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

Mon Dec 23, 2013 10:54 am

Ok, but it needs to be done only for the wifi interface. Ethernet interface must stay connected to the interent.
 
nerdtron
Member Candidate
Member Candidate
Posts: 123
Joined: Sat Nov 30, 2013 7:49 am

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

Mon Dec 23, 2013 4:35 pm

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

Who is online

Users browsing this forum: avraamd, clorichel, Gomo, GoogleOther [Bot], infabo, nigelvm and 57 guests