Since Vyos 1.2 the following bug seems to appear regarding DHCP leases. This bug does not happen with Vyos 1.1.8.
Best to test this is with VM and a passthroughed interface, like your WiFi adapter. Eg eth0:
# make sure we dhcp on the interface set interfaces ethernet eth0 address dhcp commit
We get a DHCP lease and all is good:
vyos@vyos# run show int Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- eth0 192.168.1.100/24 u/u Wi-Fi bridge
Now switch your WiFi network (that has a different subnet range) to for example your mobile phone's hotspot.
You will see that the lease is not renewed and keeps the same DHCP address.
Only way to fix this is to run run dhcp renew, but this is not ideal ofcourse:
# renew dhcp lease manually vyos@vyos# sudo /opt/vyatta/bin/sudo-users/vyatta-interfaces.pl --dhcp renew --dev eth0 # wait for a while vyos@vyos# run show interface Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- eth0 172.20.10.2/28 u/u Wi-Fi bridge
If you test this with Vyos 1.1.8 it works properly, when you switch from network: the link goes down, ip is not set, and correct DHCP lease is assigned after switching.
Other distributions like OpenBSD seem to handle this properly as well.
I have no idea where the bug could be, maybe dhclient?