TL-WR1043ND v2.1 loosing WAN address after a while

Hi,

I've installed OpenWRT on my TL-WR1043ND v2.1 (taking v2 from here).

Everything was working for a while (I guess a few hours of active usage) then I noticed no access to Internet. When I logged in into the router (via ssh) I could see that there is no IP assigned to my wan.

I was playing around with the network configuration. However, without a success. I decided to reset the router to its defaults and this helped with Internet connection. As it turned out, only for a while...

I found a similar problem here but neither unplugging and plugging a cable helps nor switching eth0 with eth1 (schema).

Although I managed to obtain IP with restarting dnsmasq yesterday, I couldn't reproduce this today :frowning:.

/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 interface 'lan'
	option type 'bridge'
	option ifname 'eth0.1'
	option proto 'static'
	option ipaddr '192.168.10.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

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

#config interface 'wan6'
#	option ifname 'eth0.2'
#	option proto 'dhcpv6'

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 '5 0t'

ifstatus wan

{
	"up": false,
	"pending": true,
	"available": true,
	"autostart": true,
	"dynamic": false,
	"proto": "dhcp",
	"device": "eth1.2",
	"data": {
		
	}
}

logread | grep eth1

Sun Jun 21 20:52:09 2020 kern.info kernel: [    1.778552] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: sgmii
Sun Jun 21 20:52:09 2020 kern.info kernel: [    6.455331] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
Sun Jun 21 20:52:09 2020 kern.info kernel: [    6.461372] IPv6: ADDRCONF(NETDEV_UP): eth1.1: link is not ready
Sun Jun 21 20:52:09 2020 kern.info kernel: [    7.538390] eth1: link up (1000Mbps/Full duplex)
Sun Jun 21 20:52:09 2020 kern.info kernel: [    7.545012] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
Sun Jun 21 20:52:09 2020 kern.info kernel: [    7.559789] IPv6: ADDRCONF(NETDEV_CHANGE): eth1.1: link becomes ready
Sun Jun 21 20:52:09 2020 kern.info kernel: [   10.156131] eth1: link down
Sun Jun 21 20:52:19 2020 kern.info kernel: [   25.213082] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
Sun Jun 21 20:52:19 2020 kern.info kernel: [   25.220331] eth1: link up (1000Mbps/Full duplex)
Sun Jun 21 20:52:19 2020 kern.info kernel: [   25.225265] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
Sun Jun 21 20:52:19 2020 daemon.notice netifd: Network device 'eth1' link is up
Sun Jun 21 20:52:19 2020 daemon.notice netifd: VLAN 'eth1.2' link is up

logread | grep wan

Sun Jun 21 20:52:19 2020 daemon.notice netifd: Interface 'wan' is enabled
Sun Jun 21 20:52:19 2020 daemon.notice netifd: Interface 'wan' has link connectivity
Sun Jun 21 20:52:19 2020 daemon.notice netifd: Interface 'wan' is setting up now
Sun Jun 21 20:52:19 2020 daemon.notice netifd: wan (1382): udhcpc: started, v1.30.1
Sun Jun 21 20:52:20 2020 daemon.notice netifd: wan (1382): udhcpc: sending discover
Sun Jun 21 20:52:23 2020 daemon.notice netifd: wan (1382): udhcpc: sending discover
Sun Jun 21 20:52:26 2020 daemon.notice netifd: wan (1382): udhcpc: sending discover

When I managed to get IP, after having broken wan, there was a notification about lease.
If I unplug or plug the cable there is no new entry in logread.

I have a second, the same router with its original firmware and have no issues with wan (therefore I assume that the cable is fine).

Do you have an idea what the cause is and how to fix it?

What is the output of this:
logread | grep udhcpc

Be sure to redact your WAN IP.

logread | grep udhcpc

Sun Jun 21 20:52:19 2020 daemon.notice netifd: wan (1382): udhcpc: started, v1.30.1
Sun Jun 21 20:52:20 2020 daemon.notice netifd: wan (1382): udhcpc: sending discover
Sun Jun 21 20:52:23 2020 daemon.notice netifd: wan (1382): udhcpc: sending discover
Sun Jun 21 20:52:26 2020 daemon.notice netifd: wan (1382): udhcpc: sending discover

That's all, no IP.

1 Like

Looks like you're not getting a DHCP response from the upstream server. What is upstream of your OpenWrt router? Is it a cable modem? Have you tried restarting it? Have you checked with your ISP to ensure that they don't have any outages or other issues that may affect your service? How often are you seeing the WAN address getting lost -- is it frequent? Is it on a predictable schedule? How long has this been happening and did you make any changes that coincided with your recent issues?

What is upstream of your OpenWrt router? Is it a cable modem? Have you tried restarting it?

I have a cable at my apartment that goes directly to my ISP device which goes to some kind of antenna that is outside. I've never had to restarted it even when I had issues with ISP.

Have you checked with your ISP to ensure that they don't have any outages or other issues that may affect your service?

I don't think it's my ISP (still, I may call them tomorrow). I have a second router (the same model) with original firmware of TP-LINK. There is no issue with obtaining WAN IP and keeping the connection (right now I'm simply switching the routers when I need my internet connection back as they are configured almost identically to my client devices; so I replace the router physically).

How often are you seeing the WAN address getting lost -- is it frequent?

After installing OpenWRT on the router. Each time after a fresh installation. Plus one situation when I managed somehow to retrieve WAN IP after it was broken (missing).

Is it on a predictable schedule?

Each time a wan ip was leased it was also lost. However, I have no idea when it happened as I could see anything in logs. Is there an easy way I can check the moment it fails?

How long has this been happening and did you make any changes that coincided with your recent issues?

That was a fresh installation on my router, then the reset to defaults. Nothing else. After this two attempts, the router is only turned on when I have a moment to dig into its issue. I have no idea whether I did sth that coincided with this behavior.

You may need to explicitly release the DHCP lease using the old router. And it is possible that the ISP needs to be involved if you change your router (back end binding of he MAC address). You could try cloning the WAN MAC address from your old router into your new one.

The command I gave earlier will give you information about the dhcp lease -- you will be able to see lease times and renewal attempts.

1 Like

The router is up and running, getting WAN IP without issues :tada: (I hope nothing else will pop up tomorrow).

Thank you @psherman the issue was the MAC address. Due to a different MAC the router was getting a wrong IP since the beginning and I didn't put much attention to that detail :woman_facepalming: ... When the right MAC was assigned (ISP updated on their side) everything simply run :slight_smile:

For anybody who will read this in the future: eth0 is WAN, eth1 is LAN (no change).

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