How do I link an interface's enabled/disabled state to a switch port's link status?

I have spectrum and their modems have a problem where the modem will give out a 192.168.100.x IP address to anything that connects to it before it gets a connection to spectrum (probably for diagnostics) and once the modem gets a connection it'll restart its ethernet interface which brings the link status down and back up to get their router to ask for a new IP. I can see that happening in real time with swconfig dev switch0 show and in the luci switch config but openwrt doesn't restart the wan interface so it's just stuck with the 192.168.100.x IP until I manually log into the router and restart the interface. Is there any way to automatically stop the interface when the link is down and start it back up when the link is back?

What about switchdev-poller?

This service monitors switchdev ports and brings down CPU ports when all related non-CPU vlan ports are also down. Otherwise, it brings the port up.


That does exactly what I need and it doesn't need any configuration either. Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.