DHCP client not getting address unless VyOS is rebooted

Just installed 1.4-rolling-202303120743-amd64.iso and was having issues with the WAN getting a DHCP address. Rebooting VyOS causes it to get a proper IP, but if I connect a new cable, it does not, until it’s rebooted.

Not able to find a Phabricator issue for this, is anyone else experiencing this with the current builds?

Can you please share your dhcp configuration and related logs.

$ show log dhcp client

So what is happening now is that VyOS will get an initial DHCP address, but if you disconnect the interface and re-connect it on another network, it does not refresh. In fact VyOS will hold onto whatever address it had even if the interface link is down.

The last thing in the DHCP client log is

Mar 17 16:00:27 dhclient-script-vyos[2800]: Applying changes via vyos-hostsd-client
Mar 17 16:00:27 dhclient-script-vyos[2800]: No changes to apply via vyos-hostsd-client
Mar 17 16:00:27 dhclient[2709]: bound to -- renewal in 35815 seconds.

And it does not change if I physically disconnect and reconnect the interface.

Tested this just now using the latest 202303170317 build.

@artooro you can use this command. When you connect your router into new network and want get IP from new DHCP server.

$ renew dhcp interface

For example:

$ renew dhcp interface eth0

@a.hajiyev sure, but let’s say I don’t have physical access and the ISP’s modem reboots and the old IP the router had is no longer valid, VyOS will be down until someone can physically get there to manually run the renew command, or just reboot the box.
Is it safe to say this is a bug right now?

When you first configured the dhcp client in the VyOS, have you checked the logs if you have received any dhcp discover message or not. And when you changed the new cable, the interface state might went down after which it again request for the address.
Reboot of the dhcp server will not make the client to loose the ip address, as they keep the record of the assiged address for specific lease time.
If you are making changes in the dhcp server for the address pool and then you have to run a renew
command in the client to get a new address.
In my virtual lab, I tested few scenrio and have disabled the interface which unassigns the
ip address immediately and when I bring the interface to UP status the address get assigned automatically
without the need for reboot.
Logs look like this:

Mar 21 04:43:17 systemd[1]: dhclient@eth2.service: Deactivated successfully.
Mar 21 04:43:17 systemd[1]: Stopped dhclient@eth2.service - DHCP client on eth2.
Mar 21 04:43:17 systemd[1]: dhclient@eth2.service: Consumed 1.406s CPU time.
Mar 21 04:44:49 systemd[1]: Starting dhclient@eth2.service - DHCP client on eth2...
Mar 21 04:44:49 systemd[1]: Started dhclient@eth2.service - DHCP client on eth2.
Mar 21 04:44:49 dhclient-script-vyos[104221]: Current dhclient PID: 104220, Parent PID: 104219, IP version: 4, All dhclients for interface eth2: 104219 104220 104246
Mar 21 04:44:49 dhclient-script-vyos[104221]: Stopping dhclient with PID: 104246, PID file: , Leases file:
Mar 21 04:44:49 dhclient-script-vyos[104221]: PID file  does not exists, killing dhclient with SIGTERM signal
Mar 21 04:44:49 dhclient-script-vyos[104221]: Passing command to /usr/sbin/ip: "link set dev eth2 up"
Mar 21 04:44:49 dhclient-script-vyos[104221]: No changes to apply via vyos-hostsd-client
Mar 21 04:44:49 dhclient[104281]: Traceback (most recent call last):
Mar 21 04:44:49 dhclient[104281]:   File "<stdin>", line 39, in <module>
Mar 21 04:44:49 dhclient[104281]: NameError: name 'secrets_lines' is not defined
Mar 21 04:44:49 root[104282]: /etc/dhcp/dhclient-exit-hooks.d/ipsec-dhclient-hook returned non-zero exit status 1
Mar 21 04:44:49 dhclient[104220]: DHCPDISCOVER on eth2 to port 67 interval 3
Mar 21 04:44:50 dhclient[104220]: DHCPOFFER of from
Mar 21 04:44:50 dhclient[104220]: DHCPREQUEST for on eth2 to port 67
Mar 21 04:44:50 dhclient[104220]: DHCPACK of from