Page MenuHomeVyOS Platform

dhcp-client doesnt get ip address
Closed, InvalidPublicBUG

Description

In 1-3..0-rc2 dhcp client can't get ip address
Only default gateway.

set interfaces ethernet eth1 address 'dhcp'

Show interfaces

vyos@r5:~$ show int
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface        IP Address                        S/L  Description
---------        ----------                        ---  -----------
eth0             192.168.122.15/24                 u/u  
eth1             -                                 u/u

As we can see in the routing table the dhcp gateway persist

S   0.0.0.0/0 [210/0] via 192.168.101.1, eth1 onlink, 00:05:24
S>* 0.0.0.0/0 [1/0] via 192.168.122.1, eth0, 00:05:26

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.3.0-rc2
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

It gets DHCP address and removes it

Mar 24 08:30:00 r5 systemd[1]: opt-vyatta-config-tmp-new_config_1159.mount: Succeeded.
Mar 24 08:30:00 r5 dhclient[1303]: DHCPOFFER of 192.168.101.145 from 192.168.101.1
Mar 24 08:30:00 r5 dhclient[1303]: DHCPREQUEST for 192.168.101.145 on eth1 to 255.255.255.255 port 67
Mar 24 08:30:00 r5 dhclient[1303]: DHCPACK of 192.168.101.145 from 192.168.101.1
Mar 24 08:30:00 r5 dhclient-script-vyos[1585]: Current dhclient PID: 1303, Parent PID: 1, IP version: -4, All dhclients for interface eth1: 1303
Mar 24 08:30:00 r5 dhclient-script-vyos[1585]: Passing command to /usr/sbin/ip: "-4 addr add 192.168.101.145/255.255.255.0 broadcast 192.168.101.255 valid_lft 3600 preferred_lft 3600 dev eth1 label eth1"
Mar 24 08:30:00 r5 sudo[1613]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/mv /tmp/config.boot.1581 /opt/vyatta/etc/config/archive/config.boot
Mar 24 08:30:00 r5 sudo[1613]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 24 08:30:00 r5 sudo[1613]: pam_unix(sudo:session): session closed for user root
Mar 24 08:30:00 r5 sudo[1618]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/logrotate -f -s /opt/vyatta/etc/config/archive/lr.state /opt/vyatta/etc/config/archive/lr.conf
Mar 24 08:30:00 r5 sudo[1618]: pam_unix(sudo:session): session opened for user root by (uid=0)
Mar 24 08:30:00 r5 dhclient-script-vyos[1585]: FRR status: running
Mar 24 08:30:00 r5 dhclient-script-vyos[1585]: Checking if the route presented in kernel: default via 192.168.101.1 dev eth1 metric 210
Mar 24 08:30:00 r5 dhclient-script-vyos[1585]: Converted vtysh command: "ip route 0.0.0.0/0 192.168.101.1 eth1 tag 210 210 "
Mar 24 08:30:00 r5 dhclient-script-vyos[1585]: Sending command to vtysh
Mar 24 08:30:00 r5 sudo[1618]: pam_unix(sudo:session): session closed for user root
Mar 24 08:30:00 r5 dhclient-script-vyos[1585]: Deleting search domains with tag "dhcp-eth1" via vyos-hostsd-client
Mar 24 08:30:00 r5 commit[1637]: Successful change to active configuration by user root on unknown
Mar 24 08:30:00 r5 systemd[1]: opt-vyatta-config-tmp-new_config_1159.mount: Succeeded.
Mar 24 08:30:00 r5 vyos-router[762]: Starting VyOS router: migrate rl-system firewall configure.
Mar 24 08:30:00 r5 systemd[1]: Reloading.
Mar 24 08:30:01 r5 vyos-config[793]: Configuration success
Mar 24 08:30:01 r5 vyos-hostsd[588]: Request data: {"type": "search_domains", "op": "delete", "data": ["dhcp-eth1"]}
Mar 24 08:30:01 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:30:01 r5 vyos-hostsd[588]: Sent response: {'data': None}
Mar 24 08:30:01 r5 dhclient-script-vyos[1585]: Adding domain name "wan2" as search domain with tag "dhcp-eth1" via vyos-hostsd-client
Mar 24 08:30:01 r5 vyos-hostsd[588]: Request data: {"type": "search_domains", "op": "add", "data": {"dhcp-eth1": ["wan2"]}}
Mar 24 08:30:01 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:30:01 r5 vyos-hostsd[588]: Sent response: {'data': None}
Mar 24 08:30:01 r5 dhclient-script-vyos[1585]: Deleting nameservers with tag "dhcp-eth1" via vyos-hostsd-client
Mar 24 08:30:01 r5 vyos-hostsd[588]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth1"]}
Mar 24 08:30:01 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:30:01 r5 vyos-hostsd[588]: Sent response: {'data': None}
Mar 24 08:30:01 r5 dhclient-script-vyos[1585]: Adding nameservers "192.168.101.1" with tag "dhcp-eth1" via vyos-hostsd-client
Mar 24 08:30:01 r5 vyos-hostsd[588]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth1": ["192.168.101.1"]}}
Mar 24 08:30:01 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:30:01 r5 vyos-hostsd[588]: Sent response: {'data': None}
Mar 24 08:30:01 r5 dhclient-script-vyos[1585]: Applying changes via vyos-hostsd-client

Logs for "Renew" procedure

Mar 24 08:49:09 r5 dhclient[2456]: Killed old client process
Mar 24 08:49:09 r5 dhclient[2456]: Killed old client process
Mar 24 08:49:10 r5 dhclient[2456]: DHCPRELEASE of 192.168.101.145 on eth1 to 192.168.101.1 port 67
Mar 24 08:49:10 r5 dhclient-script-vyos[2457]: Current dhclient PID: 2456, Parent PID: 1, IP version: -4, All dhclients for interface eth1:
Mar 24 08:49:10 r5 dhclient-script-vyos[2457]: Passing command to /usr/sbin/ip: "-4 addr flush dev eth1 label eth1"
Mar 24 08:49:10 r5 dhclient[2456]: /etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper: line 82: /usr/sbin/ip: No such file or directory
Mar 24 08:49:10 r5 dhclient-script-vyos[2457]: Deleting search domains with tag "dhcp-eth1" via vyos-hostsd-client
Mar 24 08:49:10 r5 vyos-hostsd[588]: Request data: {"type": "search_domains", "op": "delete", "data": ["dhcp-eth1"]}
Mar 24 08:49:10 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:49:10 r5 vyos-hostsd[588]: Sent response: {'data': None}
Mar 24 08:49:10 r5 dhclient-script-vyos[2457]: Deleting nameservers with tag "dhcp-eth1" via vyos-hostsd-client
Mar 24 08:49:10 r5 vyos-hostsd[588]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth1"]}
Mar 24 08:49:10 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:49:10 r5 vyos-hostsd[588]: Sent response: {'data': None}
Mar 24 08:49:10 r5 dhclient[2456]: /etc/dhcp/dhclient-exit-hooks.d/01-vyos-cleanup: line 22: [: too many arguments
Mar 24 08:49:10 r5 dhclient-script-vyos[2457]: Deleting default route: via 192.168.101.1 dev eth1 metric 210
Mar 24 08:49:10 r5 dhclient-script-vyos[2457]: FRR status: running
Mar 24 08:49:10 r5 dhclient-script-vyos[2457]: Checking if the route presented in kernel: default via 192.168.101.1 dev eth1 metric 210
Mar 24 08:49:10 r5 dhclient[2456]: /etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper: line 71: /usr/sbin/ip: No such file or directory
Mar 24 08:49:10 r5 dhclient[2456]: /etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper: line 55: /usr/sbin/ip: No such file or directory
Mar 24 08:49:10 r5 dhclient[2456]: /etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper: line 56: /usr/sbin/ip: No such file or directory
Mar 24 08:49:10 r5 dhclient-script-vyos[2457]: Converted vtysh command: "no ip route 0.0.0.0/0 192.168.101.1 eth1 tag 210 210 "
Mar 24 08:49:10 r5 dhclient-script-vyos[2457]: Sending command to vtysh
Mar 24 08:49:10 r5 dhclient-script-vyos[2457]: Applying changes via vyos-hostsd-client
Mar 24 08:49:11 r5 vyos-hostsd[588]: Request data: {"op": "apply"}
Mar 24 08:49:11 r5 vyos-hostsd[588]: Applying 2 changes
Mar 24 08:49:11 r5 vyos-hostsd[588]: Writing /etc/resolv.conf
Mar 24 08:49:11 r5 vyos-hostsd[588]: Writing /etc/hosts
Mar 24 08:49:11 r5 vyos-hostsd[588]: Writing /run/powerdns/recursor.vyos-hostsd.conf.lua
Mar 24 08:49:11 r5 vyos-hostsd[588]: Writing /run/powerdns/recursor.forward-zones.conf
Mar 24 08:49:11 r5 vyos-hostsd[588]: pdns_recursor not running, not sending "reload-lua-config"
Mar 24 08:49:11 r5 vyos-hostsd[588]: pdns_recursor not running, not sending "reload-zones"
Mar 24 08:49:11 r5 vyos-hostsd[588]: Success
Mar 24 08:49:11 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:49:11 r5 vyos-hostsd[588]: Sent response: {'data': {'message': 'Applied 2 changes'}}
Mar 24 08:49:11 r5 systemd[1]: dhclient@eth1.service: Succeeded.
Mar 24 08:49:11 r5 systemd[1]: Stopped DHCP client on eth1.
Mar 24 08:49:11 r5 systemd[1]: Starting DHCP client on eth1...
Mar 24 08:49:11 r5 systemd[1]: Started DHCP client on eth1.
Mar 24 08:49:11 r5 sudo[2453]: pam_unix(sudo:session): session closed for user root
Mar 24 08:49:11 r5 dhclient-script-vyos[2522]: Current dhclient PID: 2521, Parent PID: 2520, IP version: -4, All dhclients for interface eth1: 2520 2521
Mar 24 08:49:11 r5 dhclient-script-vyos[2522]: Passing command to /usr/sbin/ip: "link set dev eth1 up"
Mar 24 08:49:11 r5 dhclient[2520]: /etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper: line 82: /usr/sbin/ip: No such file or directory
Mar 24 08:49:11 r5 dhclient-script-vyos[2522]: No changes to apply via vyos-hostsd-client
Mar 24 08:49:11 r5 dhclient[2521]: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 7
Mar 24 08:49:11 r5 dhclient[2521]: DHCPOFFER of 192.168.101.145 from 192.168.101.1
Mar 24 08:49:11 r5 dhclient[2521]: DHCPREQUEST for 192.168.101.145 on eth1 to 255.255.255.255 port 67
Mar 24 08:49:11 r5 dhclient[2521]: DHCPACK of 192.168.101.145 from 192.168.101.1
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: Current dhclient PID: 2521, Parent PID: 1, IP version: -4, All dhclients for interface eth1: 2521
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: Passing command to /usr/sbin/ip: "-4 addr add 192.168.101.145/255.255.255.0 broadcast 192.168.101.255 valid_lft 3600 preferred_lft 3600 dev eth1 label eth1"
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: FRR status: running
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: Checking if the route presented in kernel: default via 192.168.101.1 dev eth1 metric 210
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: Converted vtysh command: "ip route 0.0.0.0/0 192.168.101.1 eth1 tag 210 210 "
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: Sending command to vtysh
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: Deleting search domains with tag "dhcp-eth1" via vyos-hostsd-client
Mar 24 08:49:11 r5 vyos-hostsd[588]: Request data: {"type": "search_domains", "op": "delete", "data": ["dhcp-eth1"]}
Mar 24 08:49:11 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:49:11 r5 vyos-hostsd[588]: Sent response: {'data': None}
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: Adding domain name "wan2" as search domain with tag "dhcp-eth1" via vyos-hostsd-client
Mar 24 08:49:11 r5 vyos-hostsd[588]: Request data: {"type": "search_domains", "op": "add", "data": {"dhcp-eth1": ["wan2"]}}
Mar 24 08:49:11 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:49:11 r5 vyos-hostsd[588]: Sent response: {'data': None}
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: Deleting nameservers with tag "dhcp-eth1" via vyos-hostsd-client
Mar 24 08:49:11 r5 vyos-hostsd[588]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth1"]}
Mar 24 08:49:11 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:49:11 r5 vyos-hostsd[588]: Sent response: {'data': None}
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: Adding nameservers "192.168.101.1" with tag "dhcp-eth1" via vyos-hostsd-client
Mar 24 08:49:11 r5 vyos-hostsd[588]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth1": ["192.168.101.1"]}}
Mar 24 08:49:11 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:49:11 r5 vyos-hostsd[588]: Sent response: {'data': None}
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: Applying changes via vyos-hostsd-client
Mar 24 08:49:11 r5 vyos-hostsd[588]: Request data: {"op": "apply"}
Mar 24 08:49:11 r5 vyos-hostsd[588]: Applying 4 changes
Mar 24 08:49:11 r5 vyos-hostsd[588]: Writing /etc/resolv.conf
Mar 24 08:49:11 r5 vyos-hostsd[588]: Writing /etc/hosts
Mar 24 08:49:11 r5 vyos-hostsd[588]: Writing /run/powerdns/recursor.vyos-hostsd.conf.lua
Mar 24 08:49:11 r5 vyos-hostsd[588]: Writing /run/powerdns/recursor.forward-zones.conf
Mar 24 08:49:11 r5 vyos-hostsd[588]: pdns_recursor not running, not sending "reload-lua-config"
Mar 24 08:49:11 r5 vyos-hostsd[588]: pdns_recursor not running, not sending "reload-zones"
Mar 24 08:49:11 r5 vyos-hostsd[588]: Success
Mar 24 08:49:11 r5 vyos-hostsd[588]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Mar 24 08:49:11 r5 vyos-hostsd[588]: Sent response: {'data': {'message': 'Applied 4 changes'}}
Mar 24 08:49:11 r5 dhclient-script-vyos[2545]: No changes to apply via vyos-hostsd-client
Mar 24 08:49:11 r5 dhclient[2521]: bound to 192.168.101.145 -- renewal in 1533 seconds.
vyos@r5:~$

The problem with "ip" path

Mar 24 12:16:41 r5 dhclient[3745]: /etc/dhcp/dhclient-enter-hooks.d/03-vyos-ipwrapper: line 82: /usr/sbin/ip: No such file or directory

root@r5:/home/vyos# file /usr/sbin/ip
/usr/sbin/ip: cannot open `/usr/sbin/ip' (No such file or directory)

Need to replace it to

/bin/ip

Or just add a symlink

sudo ln -s /bin/ip /usr/sbin/ip

Something's wrong with the filesystem; symlinks have been replaced by directories at the root:

On 1.3-beta-202103170443:

vyos@vyos# ls -l /
total 48
lrwxrwxrwx   1 root root         7 Mar 17 04:44 bin -> usr/bin
drwxr-xr-x   5 root root      4096 Mar 24 09:05 boot
drwxrwsr-x   7 root vyattacfg 4096 Mar 24 13:41 config
drwxr-xr-x  12 root root      2900 Mar 24 13:41 dev
drwxr-xr-x   1 root root      4096 Mar 24 13:41 etc
drwxr-xr-x   1 root root      4096 Mar 24 09:05 home
lrwxrwxrwx   1 root root         7 Mar 17 04:44 lib -> usr/lib
lrwxrwxrwx   1 root root         9 Mar 17 04:44 lib32 -> usr/lib32
lrwxrwxrwx   1 root root         9 Mar 17 04:44 lib64 -> usr/lib64
lrwxrwxrwx   1 root root        10 Mar 17 04:44 libx32 -> usr/libx32
drwxr-xr-x   2 root root         3 Mar 17 04:44 media
drwxr-xr-x   2 root root         3 Mar 17 04:44 mnt
drwxr-xr-x   1 root root      4096 Mar 17 04:43 opt
dr-xr-xr-x 168 root root         0 Mar 24 13:41 proc
drwx------   1 root root      4096 Mar 24 09:05 root
drwxr-xr-x  33 root root      1000 Mar 24 13:41 run
lrwxrwxrwx   1 root root         8 Mar 17 04:44 sbin -> usr/sbin
drwxr-xr-x   3 root root        27 Mar 17 04:47 srv
dr-xr-xr-x  13 root root         0 Mar 24 13:41 sys
drwxrwxrwt   9 root root       200 Mar 24 13:42 tmp
drwxr-xr-x   1 root root      4096 Mar 17 04:43 usr
drwxr-xr-x   1 root root      4096 Mar 17 04:50 var

On 1.3.0-rc2:

vyos@vyos:~$ ls -l /
total 56
drwxr-xr-x   2 root root      2182 Mar 21 08:47 bin
drwxr-xr-x   5 root root      4096 Mar 24 15:33 boot
drwxrwsr-x   7 root vyattacfg 4096 Mar 24 15:33 config
drwxr-xr-x  13 root root      2980 Mar 24 15:33 dev
drwxr-xr-x   1 root root      4096 Mar 24 15:33 etc
drwxr-xr-x   1 root root      4096 Mar 24 15:33 home
drwxr-xr-x   1 root root      4096 Mar 21 08:36 lib
drwxr-xr-x   2 root root        43 Mar 21 08:38 lib64
drwxr-xr-x   2 root root         3 Mar 18 15:23 media
drwxr-xr-x   2 root root         3 Mar 18 15:23 mnt
drwxr-xr-x   1 root root      4096 Mar 21 08:36 opt
dr-xr-xr-x 178 root root         0 Mar 24 15:33 proc
drwx------   1 root root      4096 Mar 24 15:33 root
drwxr-xr-x  32 root root       980 Mar 24 15:33 run
drwxr-xr-x   2 root root      2474 Mar 21 08:47 sbin
drwxr-xr-x   3 root root        27 Mar 21 08:43 srv
dr-xr-xr-x  13 root root         0 Mar 24 15:33 sys
drwxrwxrwt  10 root root       240 Mar 24 15:33 tmp
drwxr-xr-x   1 root root      4096 Mar 21 08:36 usr
drwxr-xr-x   1 root root      4096 Mar 21 08:46 var

Everything looks fine on a 1.3 ISO I just built from source:

vyos@vyos:~$ ls -l /
total 48
lrwxrwxrwx   1 root root         7 Mar 24 16:42 bin -> usr/bin
drwxr-xr-x   5 root root      4096 Mar 24 16:58 boot
drwxrwsr-x   7 root vyattacfg 4096 Mar 24 17:02 config
drwxr-xr-x  12 root root      2900 Mar 24 17:02 dev
drwxr-xr-x   1 root root      4096 Mar 24 17:02 etc
drwxr-xr-x   1 root root      4096 Mar 24 16:58 home
lrwxrwxrwx   1 root root         7 Mar 24 16:42 lib -> usr/lib
lrwxrwxrwx   1 root root         9 Mar 24 16:42 lib32 -> usr/lib32
lrwxrwxrwx   1 root root         9 Mar 24 16:42 lib64 -> usr/lib64
lrwxrwxrwx   1 root root        10 Mar 24 16:42 libx32 -> usr/libx32
drwxr-xr-x   2 root root         3 Mar 24 16:42 media
drwxr-xr-x   2 root root         3 Mar 24 16:42 mnt
drwxr-xr-x   1 root root      4096 Mar 24 16:26 opt
dr-xr-xr-x 187 root root         0 Mar 24 17:02 proc
drwx------   1 root root      4096 Mar 24 16:58 root
drwxr-xr-x  33 root root      1000 Mar 24 17:03 run
lrwxrwxrwx   1 root root         8 Mar 24 16:42 sbin -> usr/sbin
drwxr-xr-x   3 root root        27 Mar 24 16:46 srv
dr-xr-xr-x  13 root root         0 Mar 24 17:02 sys
drwxrwxrwt   9 root root       220 Mar 24 17:03 tmp
drwxr-xr-x   1 root root      4096 Mar 24 16:26 usr
drwxr-xr-x   1 root root      4096 Mar 24 16:48 var

Is there a problem on the build machine?

It was a broken image.