Ethernet WAN port does not detect cable unplugging

Hi, i installed OpenWRT 19.7.2 on my EdgeRouter-X properly.

My ISP works under DHCP leasing. My problem is related to WAN connection: If I turnoff my modem or unplug and plug again the ethernet to my ER-X, OpenWRT does not detect that nor down the interface, then does not negotiate a new IP.

To get internet working again I must restart the interface manually.

How can I handle this issue? Thanks!

Example: I turn off my modem and I see this:
.Untitled

Hello, what is the output of uci export network ?

Use ssh to connect to the device.

Please use the "Preformatted text </>" button for logs, scripts, configs and general console output.
grafik
Please edit your post accordingly. Thank you! :slight_smile:

Hi trendy, here is the output. Thank you.

# uci export network
package 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 'fd67:63e4:92f8::/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 'XXXX'

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

config device 'wan_eth0_2_dev'
	option name 'eth0.2'
	option macaddr 'XXXX'

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

Nothing out of the ordinary here.
When you plug out the cable, do you see in Network-Switch page in Luci that the cable was removed?
Or if you give swconfig dev switch0 show , port 0 should show as down.

It is weird, occurs at same time. :frowning:

Are there any logs that the interface went down?
ifstatus wan; logread | grep -i wan; echo ; echo ; echo ; logread | grep -i eth0.2

I have the same output with and without the cable attached to the WAN port :cry:

# ifstatus wan; logread | grep -i wan; echo ; echo ; echo ; logread | grep -i eth0.2
{
	"up": true,
	"pending": false,
	"available": true,
	"autostart": true,
	"dynamic": false,
	"uptime": 21895,
	"l3_device": "eth0.2",
	"proto": "dhcp",
	"device": "eth0.2",
	"updated": [
		"addresses",
		"routes",
		"data"
	],
	"metric": 0,
	"dns_metric": 0,
	"delegation": true,
	"ipv4-address": [
		{
			"address": "X.X.X.91",
			"mask": 23
		}
	],
	"ipv6-address": [
		
	],
	"ipv6-prefix": [
		
	],
	"ipv6-prefix-assignment": [
		
	],
	"route": [
		{
			"target": "0.0.0.0",
			"mask": 0,
			"nexthop": "X.X.X.X",
			"source": "X.X.X.91/32"
		}
	],
	"dns-server": [
		"X.X.X.X",
		"X.X.X.X"
	],
	"dns-search": [
		"my.isp.dns"
	],
	"neighbors": [
		
	],
	"inactive": {
		"ipv4-address": [
			
		],
		"ipv6-address": [
			
		],
		"route": [
			
		],
		"dns-server": [
			
		],
		"dns-search": [
			
		],
		"neighbors": [
			
		]
	},
	"data": {
		"hostname": "OpenWrt",
		"leasetime": 63307
	}
}
Thu Feb 27 21:05:21 2020 daemon.notice netifd: Interface 'wan' is enabled
Thu Feb 27 21:05:21 2020 daemon.notice netifd: Interface 'wan6' is enabled
Thu Feb 27 21:05:21 2020 daemon.notice netifd: Interface 'wan' has link connectivity
Thu Feb 27 21:05:21 2020 daemon.notice netifd: Interface 'wan' is setting up now
Thu Feb 27 21:05:21 2020 daemon.notice netifd: Interface 'wan6' has link connectivity
Thu Feb 27 21:05:21 2020 daemon.notice netifd: Interface 'wan6' is setting up now
Thu Feb 27 21:05:21 2020 daemon.notice netifd: wan (1153): udhcpc: started, v1.30.1
Thu Feb 27 21:05:22 2020 daemon.notice netifd: wan (1153): udhcpc: sending discover
Thu Feb 27 21:05:22 2020 daemon.notice netifd: wan (1153): udhcpc: sending select for X.X.X.91
Thu Feb 27 21:05:22 2020 daemon.notice netifd: wan (1153): udhcpc: lease of X.X.X.91 obtained, lease time 63307
Thu Feb 27 21:05:22 2020 daemon.notice netifd: Interface 'wan' is now up
Thu Feb 27 21:05:22 2020 user.notice firewall: Reloading firewall due to ifup of wan (eth0.2)



Thu Feb 27 21:05:21 2020 daemon.notice netifd: VLAN 'eth0.2' link is up
Thu Feb 27 21:05:22 2020 user.notice firewall: Reloading firewall due to ifup of wan (eth0.2)

# date
Thu May  7 19:39:53 UTC 2020

I have the feeling that something similar has been discussed before, but I cannot find it.
I summon @mk24, @lantis1008, @slh as they were involved in some similar topic and they might have something to suggest.

maybe this: Mtk7621 netifd can not receive switch link up/down events?

Not the one I had in mind, but still worth to have a look.
@jow maybe any idea?