WAN side IP Not updating upon Ethernet plug is unplugged and plug from another provider

devices with OpenWrt 22.03.5.

7 devices, mostly TP-Link, if I unplug the ethernet cable from the WAN socket on the router and plug in another one from a different supplier, without rebooting the OWRT router, It does not acquire the IP from this newly connected supplier, it stays with the old IP and never renews!

It's not exactly clear what you're describing... maybe you can clarify.

  1. Are you testing with all 7 devices?
  2. Are all 7 devices running OpenWrt?
  3. Are all of the devices you've tested configured similarly?
  4. What is your service type (cable modem, DSL, fiber, cellular)?
  5. What is the device that is physically upstream (that you're connecting to the wan port)? Is it a modem? ONT? router? modem+router combo unit?
  6. Are you using multiple different ISPs? Are those ISPs using different modems/routers?
  1. What does this mean? Can you give an example of what the "old IP" is? (just the first 2 octets is fine)
  2. Does the internet connectivity work?
1 Like
  1. Are you testing with all 7 devices?
    Same issue with all seven devices
  2. Are all 7 devices running OpenWrt?
    Yes
  3. Are all of the devices you've tested configured similarly?
    They are all router doing their respective roles, in between 2 LANS like that:
    client----openWRT-------ONT/5G----Internet
  4. What is your service type (cable modem, DSL, fiber, cellular)?
    DSL, Fiber and Cellular
  5. What is the device that is physically upstream (that you're connecting to the wan port)? Is it a modem? ONT? router? modem+router combo unit?
    ONT, Modem/Router combo unit huawei, Cellular phone 5G with usb tetering to usbc ethernet port etc.
  6. Are you using multiple different ISPs? Are those ISPs using different modems/routers?
    Yes
  7. What does this mean? Can you give an example of what the "old IP" is? (just the first 2 octets is fine)
    OpenWRT is using internet from the ethernet WAN upstream coming from a cellular phone, WAN port unplugged another cable from ONT is plugged in and the ONT is configured with different IP. The WAN interface on the OpenWRT devive keep the previous allocated IP from the cellular phone device unless I restart the WAN interface on the OpenWRT to force it to reaquire newly connected ip from ONT.
  8. Does the internet connectivity work?
    Yes

To be clear, the celluar, ONT and cable all 3 use the same RJ-45 Ethernet WAN port on all 7 devices, correct?

Provide details - this description sounds like you're switching both WAN and WAN Interfaces, but you provide no details on how 2 WANs are setup and configured to simultaneously exist on the same device.

Post your persistent and runtime configs for the L2 and L3 when the issue happens.
Unplug the cable, wait a few seconds, check if the status of the L2 changes.
Enable and check hotplug logging for the iface and net event types.

To be clear, the celluar, ONT and cable all 3 use the same RJ-45 Ethernet WAN port on all 7 devices, correct?
dont get your question right here.
the devices got their respective WAN ports. where i unplug, say the ethernet cable from the ONT and plug in the ethernet cable from the tethered dongle. its a physical disconnection where I expect the WAN interface on the owrt to be completely OFF and when I plug in the another upstream device it goes back up with new IP from this new upstream device.

2 WAN does not exist on the same device together, its after physically disconnecting the device and pluging in another that causing the issue, the WAN interface on the owrt router keept the ip from the previous device even when nothing is connected in the WAN port.

how please? link or guide somewhere?

Apologies I wasn't clear, I even explained the premise of my question:

Then please post your configs as requested.

EDIT: :spiral_notepad: To be clear, if you desire 2 WANs on your device, you must configure 2 WANs to simultaneously exist at the same time. Otherwise, you should expect a need to restart your network after properly configuring WAN_B and vice versa.

sorry this is not a configuration with miltiwan, its just an issue where the device is unable to dynamically detect that wan is physically disconnected when no wires goes into the wan physical plug if it were previously connected, so the owrt router keep the last known configuration and never update unless pgysically rebooted or ssh in and restarting the WAN interface.

I can assume none of your devices use DSA - if you have the Switch page in the Network menu then it doesn't.

When that is the case, wan is not connected directly to the physical port, instead, it is connected to a switch.

When WAN port goes through a switch, the actual network interface doesn't see that it is connected or disconnected, and while it has a valid DHCP lease it won't request a new one. This topic and parsing /etc/board.json can possibly help you, but some coding is needed for sure.

devices:
TL-WR1043ND v2
WDR4300 v1.7
c2600 v1.0

devices being prepared for deployment.

ah!

I C!

thank you

Let’s see the network config of one of these devices.

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network

I am correct - none of these device use DSA, and although they probably will in the future - once qca9k driver gets fixed. But for now they still use the older switch driver.

I already see that C2600 has been migrated to qca9k and DSA in the main branch - in snapshot builds so the workaround below won't be needed any more.

A way to work around this for now is to create a script that will be called every minute or even faster, or even in a loop:

#!/bin/sh

# for 1043NDv2 and C2600
wasup=1
while true; do

if swconfig dev switch0 show | grep link | grep port:5 | grep down; then
  if [ "$wasup" == "1" ]; then
    wasup=0
    ifdown wan
  fi
else
  if [ "$wasup" == "0" ]; then
    wasup=1
    ifup wan
  fi
fi

sleep 5
done

for WDR4300 change the grep port:5 to: grep port:1

1 Like

thank you, I will use other new devices for this project instead of recycling these old devices

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