How to restart interface on physical port state change?

The device is a dumb AP connected to upstream directly via ethernet. The upstream router is a Gl.iNet Flint 2 also running 24.10.0.

When the upstream router restarts, the AP doesn't seem to respond at all, despite the change of physical link state.

For example, it still treats the old SLAAC IPv6 prefix as valid, which causes the services running on it to continue clinging on the old and potentially unroutable address.

Hotplug scripts aren't being executed based on my testing, unless it's more complex than just writing a script.

So, is there a way to restart interfaces/run ifup when a physical port loses connection?

The AP is an Linksys E8450 running OpenWrt 24.10.0, with the following network configs:

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd92:c9df:36a3::/48'
	option packet_steering '2'
	option steering_flows '128'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'

config interface 'lan'
	option device 'br-lan.10'
	option proto 'dhcp'
	option delegate '0'

config device
	option name 'wan'
	option macaddr '12:34:56:78:9A:BC'

config bridge-vlan
	option device 'br-lan'
	option vlan '10'
	list ports 'lan1:u*'
	list ports 'lan2:t'

config bridge-vlan
	option device 'br-lan'
	option vlan '20'
	list ports 'lan2:t*'
	list ports 'lan3:u*'

config interface 'clients_dummy'
	option proto 'none'
	option device 'br-lan.20'
	option delegate '0'

config interface 'lan_6'
	option proto 'dhcpv6' # upstream is SLAAC only!
	option device 'br-lan.10'
	option reqaddress 'try'
	option reqprefix 'auto'
	option delegate '0'
	option ip6ifaceid 'eui64'
	option norelease '0'

config bridge-vlan
	option device 'br-lan'
	option vlan '30'
	list ports 'lan2:t'

config interface 'guests_dummy'
	option proto 'none'
	option device 'br-lan.30'
	option delegate '0'

IMHO restarting the interface is just a workaround, not a solution to your problem. If there was a switch involved, there wouldn't be a link up/down event at all.

I'm not an expert when it comes to IPv6, but since you configured DHCPv6, this seems like the correct behavior, i.e. it keeps the lease as long as it's not expired. I suppose that you can get around this by either:

  • Setting a static IPv6 address - since you mentioned that you have services running, that would probably be a good idea
  • Relying on SLAAC only - if I read the documentation correctly, that would mean setting reqprefix to none.

Maybe someone more knowledgeable with IPv6 can give more insights?

Sorry for the ambiguous config, upstream router doesn't have a DHCPv6 server, the network is SLAAC only.
I should learn to ask better questions in future...


The upstream router is a Gl.iNet Flint 2 also running 24.10.0.


Can odhcpd send zero lifetime deprecation RAs on shutdown/reboot? radvd supports this feature.

Though another issue is RFC 4862 states that clients should ignore short valid lifetime unless the RA is authenticated somehow. Does OpenWrt check this?
Well maybe I can ignore this since it's just a small private network...