Restart network of other AP

Hi,
I have Main router and Dumb AP
How can I run the code "/etc/init.d/network restart" in the Dumb AP every time the Main router is boot?

I mean:

When Main router is Boot ---> Dumb AP restarting network

Thanks

You can, but why ?

2 Likes

If we leave the discussion if the other AP even have support for that and take question no 1 first.

So question 1, why do you need to do that to begin with?

2 Likes

I use dropbear to share Associated Stations
hostnames between both Main Router and dumb AP.
If im restarting the Main router, the Dumb AP is "?" Instead hostnames.
I have to restart network of Dumb AP to make everything ok.

Are the AP running OpenWrt to begin with?

I don’t really know what dropbear are supposed to do in your setup?
This hostname data should be handled and solved by the only dhcp/dns server in the system and that should normally be in the router.

A dumb AP is only “network technology shifter” that means a wifi radio and ethernet switch. It doesn’t do anything smart (it is called dumb by a reason), every bit of smart thinking in the network is done by the router.

1 Like

You can populated /etc/ethers to solve the ? issue on the AP.

1 Like

This is the method im using:

If im restarting the Main router, the hostnames are not getting sync.

what error are you getting on the AP ?

While I don't necessarily think restarting your other AP is the best approach (although I don't have a better idea), if it does allow the hostnames to re-sync, it would solve the problem at hand.

You'll need key-based ssh from the main router > AP. You could insert a line into the rc.local file like this:

ssh root@<ip.of.other.ap> reboot now

This will fire off the reboot as the main router is in the later stages of booting up (nearing boot completion).

EDIT: it looks like you just want to restart the network stack alone...

ssh root@<ip.of.other.ap> /etc/init.d/network restart
2 Likes

this should fail just as much as the cron:ed sync from the AP, IMHO, but I love the idea.

Why you think it would not work?

EDIT::
It doesn't working

for the same reason it doesn't work from the AP, why, I still haven't managed to figure out :wink:

1 Like

Is reboot now even a command? OpenWrt reboot on enter if you write reboot, at least my does that and my big config script need me to make a reboot when I am done.

This command is working in rc.local:

HOME=/root
USER=root
ssh 192.168.1.2 "/etc/init.d/network restart"

But, the Main router is not renewing DHCP leases after the reboot. Very weird. Why is that happening?

Is the main router failing to renew leases (i.e. devices end up offline and cannot get an address), or is it simply not repopulating the lease table after the network restart action?

The Dumb AP is restarting the lease. (ssh command from main router to restart dumb ap network is working)
But the Main router himself is still on the old lease....

Devices are online and lease is same as before reboot...

It should be the same. Are you expecting something different? If so, can you explain in more detail?

It shouldn't be the same ..
If my Main Router is rebooted, the devices are disconnecting from the router for few seconds.
Means new dhcp lease.

Im talking about the lease time. No names.

After reboot I see the Dumb AP leases are 7h 59m(set to 8h - it's ok)
And the Main Router devices are same as before reboot. For example 5h etc...

The clients should request a new lease if their interface actually bounces... so ethernet and/or wifi actually going down momentarily should cause the clients to request a lease renewal. However, if the interface to which they are connected doesn't actually go down, it will not trigger this process. A good example is a computer connected to an ethernet switch when the reboot of the router occurs... the link between the switch and the computer doesn't bounce even though the router was rebooted. The same thing happens with a device connected to an AP if the radio itself stays active.

Are you positive that the link itself is actually being bounced?

Yes, reboot is disconnect my devices 100%
If im removing the ssh line from rc.local I can see the dhcp leases is restarting after reboot. Very weird