Community discussions

MikroTik App
 
Reefbum
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 64
Joined: Sun Apr 23, 2006 12:00 am

IP Release on WLAN disconnect?

Tue Jul 17, 2018 10:15 pm

I am using an MK GrooveA on my RV roof as a wlan station to connect to campground AP.
wlan1 is setup with dhcp client to take IP from campground when it connects to their AP
ether1 is setup as dhcp server that connects to my MK HAP Lite inside the RV
HAP is setup in bridge and all my devices take an IP from the MK Groove
This is all working well but with an issue I would like to fix.
When the campground wireless goes out (few times a day) I have my iphone setup in the connect-list of the groove so that it will fail over to my iphone hotspot.
The groove does connect to iphone automatically but wont take an IP from it.
I have to login via MAC address on Winbox and do a manual IP release on the wlan1 DHCP Client. The instant I click release it takes an IP from iphone an all is well again until next time.

Is there any script/setting that can automatically do a DHCP "release" on the DHCP client every time the wlan1 disconnects?
 
gotsprings
Forum Guru
Forum Guru
Posts: 2122
Joined: Mon May 14, 2012 9:30 pm

Re: IP Release on WLAN disconnect?

Tue Jul 17, 2018 11:38 pm

 
Reefbum
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 64
Joined: Sun Apr 23, 2006 12:00 am

Re: IP Release on WLAN disconnect?

Tue Jul 17, 2018 11:47 pm

That example only details how to add/remove default route.
I'm trying to release the dhcp client IP on wlan1 disconnect.
 
gotsprings
Forum Guru
Forum Guru
Posts: 2122
Joined: Mon May 14, 2012 9:30 pm

Re: IP Release on WLAN disconnect?

Fri Jul 20, 2018 4:58 pm

The link I mentioned showed how to DO SOMETHING when an interface gets and looses an IP on a DHCP interface.

If you wanna script it... look for this value to become "false"
:local wlanstatus [/interface get [find name=wlan1] running]

But to keep it simple... why not use a simple netwatch and ping an external host like 8.8.8.8
If it fails...
/ip dhcp-client release 0

That would do what you are asking.

Who is online

Users browsing this forum: No registered users and 35 guests