Page MenuHomeVyOS Platform

Disabled vif interface with "address dhcp" requests DHCP address
Resolved (N/A)PublicBUG


If an interface is disabled and configured to request its address from a DHCP-server, the interface will still get an IP-address (at least during boot)
I would expect that the "disabled"-statement would override/disable the dhcp process.

For recreation:

 ethernet eth0 {
     vif 2 {
          address dhcp

save the configuration and reboot

I am trying have a DHCP-interface as a backup interface only to be enabled in failure-scenarios. As of now this is not working, and the interface grabs a DHCP-address during boot.


Difficulty level
Unknown (require assessment)
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

dhclient script up this interface after hooks


run_hook /etc/dhcp/dhclient-enter-hooks
run_hookdir /etc/dhcp/dhclient-enter-hooks.d

# Execute the operation
case "$reason" in

    ### DHCPv4 Handlers

        # Do nothing
        # The DHCP client is requesting that an interface be
        # configured as required in order to send packets prior to
        # receiving an actual address. - dhclient-script(8)

        # ensure interface is up
        ip link set dev ${interface} up
erkin renamed this task from Disabled vif interface with "address dhcp" requests DHCP address. to Disabled vif interface with "address dhcp" requests DHCP address.Aug 30 2021, 8:02 AM
erkin set Issue type to Bug (incorrect behavior).
dmbaturin added a project: VyOS 1.4 Sagitta.

Seems fixed:
Before reboot:

set interfaces ethernet eth1 description 'LAN'
set interfaces ethernet eth1 hw-id '52:54:00:04:33:2b'
set interfaces ethernet eth1 vif 20 address 'dhcp'
set interfaces ethernet eth1 vif 20 disable

after reboot

vyos@r4:~$ show int
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface    IP Address         MAC                VRF        MTU  S/L    Description
-----------  -----------------  -----------------  -------  -----  -----  -------------
eth0  52:54:00:f1:fd:77  default   1500  u/u    WAN
eth1         -                  52:54:00:04:33:2b  default   1500  u/u    LAN
eth1.20      -                  52:54:00:04:33:2b  default   1500  A/D

Tested on: VyOS 1.5-rolling-202401140026 and VyOS 1.3.5