Hi,
I'm using Backfire 10.03.1-rc5 on a Netgear WNDR3700 v1, connected on the WAN side to a SMC cable modem. The cable modem and the Netgear both have static routable IPs on the public interfaces (so to be clear, the Netgear is not configured to run a DHCP client on the WAN interface).
The thing is, the Netgear appears to boot faster than the modem, so when power is restored to both simultaneously, the Netgear boots first and apparently doesn't bring up the WAN interface because the link is not active. I haven't spent a great deal of time looking into what exactly is going on, but the WAN interface never becomes active in the dmesg output, and sure enough, if I log in from the LAN, the WAN interface is UP but not RUNNING.
So it seems reasonable enough to have a boot script that sleeps for a couple of minutes and then restarts WAN connectivity. But I find myself stumped on the simplest part--how to restart WAN connectivity without just rebooting (and a post-boot script that sleeps for a bit and then reboots if the Internet is not accessible is a bad recipe for a reboot loop, so I'd rather avoid that path).
ifdown && ifup eth1 results in:
interface not found.
interface not found.
/sbin/uci: Invalid argument
/sbin/uci: Invalid argument
Interface type not supported.
To be honest, I hate shell scripting, so I have not dug into the cause of this.
Bringing down the interface and back up via ifconfig down/up does not fix the issue.
/etc/init.d/networking restart outputs "command failed: No such device (-19)" and, again, does not fix the issue.
So I could certainly dig into these errors a bit and figure out what commands are failing, but perhaps someone here can save me the trouble?
More generally, I have two questions:
1. Is there a better way to detect the WAN activation than sleeping after boot or polling in a cron job?
2. What's the best way to react to WAN activation short of a reboot?
Thanks!
Edit: FYI, at the moment I'm doing the horrible hackish reboot-if-the-network-is-down script I described. It's a workable solution, to be sure, but really even sadder than duct tape.
(Last edited by Dan0 on 28 Aug 2011, 07:05)