Summary
I have a LTE/5G modem plugged on eth1. The address on this interface is assigned with DHCP and the cable has some issue so some times it disconnects and reconnects. I expect it to start working(modem's interface should be reachable and I should be able to access the internet using that device) after the link is back online but that does not happen.
DHCP lease reports every thing is okay, the interface has address assigned and the route exists but nothing is reachable.
vyos@router# run show dhcp client leases Interface eth1 IP address 100.90.76.10 [Active] Subnet Mask 255.0.0.0 Domain Name Router 100.0.0.1 Name Server 117.96.122.72 59.144.144.99 DHCP Server 192.168.8.1 DHCP Server 86400 VRF default Last Update Wed Oct 25 22:41:35 IST 2023 Expiry Thu Oct 26 22:41:35 IST 2023
Steps to reproduce:
- Create a ethernet interface which fetches IP with DHCP
- Disable link(by removing cable or disabling the interface of virtualized instance)
- Enable link by plugging the cable back in
The exact config for this ethernet interface in my setup
address dhcp dhcp-options { default-route-distance 2 } hw-id a8:b8:e0:00:4a:d8 redirect ifb0
Expected:
Connectivity to resources on this link should be restored after the link is online
What actually happens:
It stops working. The interface has address from dhcp, the route is there but I can not reach any thing on the other side.
Logs
[188443.255622] igc 0000:02:00.0 eth1: NIC Link is Down [188475.901593] igc 0000:02:00.0 eth1: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX [188481.197040] igc 0000:02:00.0 eth1: NIC Link is Down [188484.449365] igc 0000:02:00.0 eth1: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
Additional details
I suspect this is happening because when link goes down, the bridged 5g modem discards whatever state it has for the address assigned to the vyos router. When the router link goes back online, vyos tries to use the same address but the 5g modem now has no information about this lease and it doesn't accept any traffic from it.
The way I fix it is by releasing the lease and renewing it which almost always gives me a completely different IP address.
vyos should handle this a bit better. It should release dhcp addresses when the associated link goes down and renew them when the link comes back up.
Back in mikrotik land, The dhcp client works exactly like this