After reboot, WAN DHCP connects but will not do anything until after 5 minutes of uptime

Hi im new to OpenWRT and been setting up my Edgerouter X for it. I have my network trough DHCP and has been no issue for me until rebooting.

When rebooting everything looks fine, the WAN network comes up instantly with both an address, gateway, dns 1&2. But i cannot ping the gateway, dns or anything else thats not in my LAN. Its not until after 5 or so minutes it suddenly starts working. No restarting of services, interfaces, changing options or unplugging changes this situation. I have to wait for the 5 minute uptime. Then it will work no problem and this behaviour doesnt happen again until another reboot.

I have stared at the log outputs and there is no entries around when the internet starts to work. Its completely silent.

/etc/config/network


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

config globals 'globals'
	option ula_prefix 'fd26:*snip*:4593::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0.1'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config device 'lan_eth0_1_dev'
	option name 'eth0.1'
	option macaddr '74:*snip*:03:ae'

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config device 'wan_eth0_2_dev'
	option name 'eth0.2'
	option macaddr '74:*snip*:03:af'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'dhcpv6'
	option reqprefix 'auto'
	option reqaddress 'try'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 2 3 4 6t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0 6t'

This sounds suspiciously like a problem at the ISP end, maybe they aren't properly configuring routing until the first DHCP renewal or something like that

1 Like

What is confusing is that unplugging the ISP and re plugging it works fine after the 5 minute mark. Get a DHCP response and it starts working in seconds after replugging it or restarting the interface.

It is only when i reboot my router that the "5 minute timer" starts. And nothing i do in that window seems to help other than waiting for that magical number of minutes. Everything in the logs and luci show to be already working at boot. It just doesnt for some reason unless i wait it out for a while.

You may have been on about something about the ISP end. My DHCP leases keep being 1 hour long. Ill keep a closer eye on this behavior.

Does it help if you perform DHCP release before rebooting?

My own solution was to upgrade to OpenWRT 21.02, it seems to have fixed these issues for me.

1 Like

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