Issue adding kernel route

Hello,
I’m runnig VyOS 1.3, here is version output:

vyos@vyos:~$ show version
Version:          VyOS 1.3-rolling-202004150454
Built by:         autobuild@vyos.net
Built on:         Wed 15 Apr 2020 04:54 UTC
Build UUID:       3f4953e7-377f-4a54-a7c3-7d69c61c458c
Build Commit ID:  b8ef397f5a9562

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest

Hardware vendor:  Hetzner
Hardware model:   vServer
Hardware S/N:     7094552
Hardware UUID:    d8636e5f-262b-4514-becd-fd1ac595f2ad

Copyright:        VyOS maintainers and contributors
vyos@vyos:~$

I want to add kernel routes, however I met strange (to me at least) behaviour:

root@vyos:/home/vyos# ip ro add 1.1.1.1/32 via 172.31.1.1
Error: Nexthop has invalid gateway.

But:

root@vyos:/home/vyos# ip ro
default via 172.31.1.1 dev eth0 proto static metric 20 onlink
10.0.0.0/16 via 10.0.0.1 dev eth1 proto static metric 20 onlink
10.0.0.1 dev eth1 proto static metric 20
172.31.1.1 dev eth0 proto static metric 20

As you can see 172.31.1.1 is connected, moreover default route is pointed to the address and it works.

Welcome to VyOS community.

Could you please provide these additional details to understand your setup:

show configuration commands
sudo ip a
sudo ip r
sudo vtysh -c ‘show running-config’
sudo journalctl -b | grep dhcp

Hello!
Here it is.
show configuration commands:

set firewall all-ping 'enable'
set firewall broadcast-ping 'disable'
set firewall config-trap 'disable'
set firewall ipv6-receive-redirects 'disable'
set firewall ipv6-src-route 'disable'
set firewall ip-src-route 'disable'
set firewall log-martians 'enable'
set firewall name LOCAL default-action 'drop'
set firewall name LOCAL rule 10 action 'accept'
set firewall name LOCAL rule 10 destination address 'xxx.xxx.179.208'
set firewall name LOCAL rule 10 destination port '8063'
set firewall name LOCAL rule 10 protocol 'tcp'
set firewall name LOCAL rule 10 source address 'xxx.xxx.124.158'
set firewall receive-redirects 'disable'
set firewall send-redirects 'enable'
set firewall source-validation 'disable'
set firewall syn-cookies 'enable'
set firewall twa-hazards-protection 'disable'
set interfaces ethernet eth0 address 'dhcp'
set interfaces ethernet eth0 firewall local name 'LOCAL'
set interfaces ethernet eth1 address 'dhcp'
set interfaces ethernet eth1 mtu '1450'
set interfaces loopback lo address 'xxx.xxx.179.208/32'
set nat source rule 10 outbound-interface 'eth0'
set nat source rule 10 source address 'xxx.xxx.0.2'
set nat source rule 10 translation address 'xxx.xxx.179.208'
set service ssh ciphers '3des-cbc'
set service ssh ciphers 'aes128-cbc'
set service ssh ciphers 'aes128-ctr'
set service ssh ciphers 'aes128-gcm@openssh.com'
set service ssh ciphers 'aes192-cbc'
set service ssh ciphers 'aes192-ctr'
set service ssh ciphers 'aes256-cbc'
set service ssh ciphers 'aes256-ctr'
set service ssh ciphers 'aes256-gcm@openssh.com'
set service ssh disable-host-validation
set service ssh key-exchange 'curve25519-sha256'
set service ssh key-exchange 'curve25519-sha256@libssh.org'
set service ssh key-exchange 'diffie-hellman-group14-sha1'
set service ssh key-exchange 'diffie-hellman-group14-sha256'
set service ssh key-exchange 'diffie-hellman-group16-sha512'
set service ssh key-exchange 'diffie-hellman-group18-sha512'
set service ssh key-exchange 'diffie-hellman-group1-sha1'
set service ssh key-exchange 'diffie-hellman-group-exchange-sha1'
set service ssh key-exchange 'diffie-hellman-group-exchange-sha256'
set service ssh key-exchange 'ecdh-sha2-nistp256'
set service ssh key-exchange 'ecdh-sha2-nistp384'
set service ssh key-exchange 'ecdh-sha2-nistp521'
set service ssh listen-address 'xxx.xxx.179.208'
set service ssh mac 'hmac-md5'
set service ssh mac 'hmac-md5-96'
set service ssh mac 'hmac-md5-96-etm@openssh.com'
set service ssh mac 'hmac-md5-etm@openssh.com'
set service ssh mac 'hmac-sha1'
set service ssh mac 'hmac-sha1-96'
set service ssh mac 'hmac-sha1-96-etm@openssh.com'
set service ssh mac 'hmac-sha1-etm@openssh.com'
set service ssh mac 'hmac-sha2-256'
set service ssh mac 'hmac-sha2-256-etm@openssh.com'
set service ssh mac 'hmac-sha2-512'
set service ssh mac 'hmac-sha2-512-etm@openssh.com'
set service ssh mac 'umac-128-etm@openssh.com'
set service ssh mac 'umac-128@openssh.com'
set service ssh mac 'umac-64-etm@openssh.com'
set service ssh mac 'umac-64@openssh.com'
set service ssh port '8063'
set system config-management commit-revisions '100'
set system console device ttyS0 speed '115200'
set system host-name xxxxxx
set system login user xxxxxx authentication encrypted-password xxxxxx
set system login user xxxxxx authentication plaintext-password xxxxxx
set system name-server 'xxx.xxx.8.8'
set system name-servers-dhcp 'eth0'
set system name-servers-dhcp 'eth1'
set system ntp server xxxxx.tld
set system ntp server xxxxx.tld
set system ntp server xxxxx.tld
set system options reboot-on-panic
set system syslog global facility all level 'info'
set system syslog global facility protocols level 'debug'
set system time-zone 'Europe/Helsinki'

sudo ip a:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet 95.216.179.208/32 scope global lo
       valid_lft forever preferred_lft forever
    inet6 fe80::200:ff:fe00:0/64 scope link
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 96:00:00:66:fc:f8 brd ff:ff:ff:ff:ff:ff
    inet 95.216.215.168/32 brd 95.216.215.168 scope global dynamic eth0
       valid_lft 83517sec preferred_lft 83517sec
    inet6 fe80::9400:ff:fe66:fcf8/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 86:00:00:66:fc:f9 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.3/32 brd 10.0.0.3 scope global dynamic eth1
       valid_lft 55664sec preferred_lft 55664sec
    inet6 fe80::8400:ff:fe66:fcf9/64 scope link
       valid_lft forever preferred_lft forever

sudo vtysh -c ‘show running-config’:

Current configuration:
!
frr version 7.3.1-20200726-01-g0cae52083
frr defaults traditional
hostname debian
log syslog informational
hostname vyos
service integrated-vtysh-config
!
ip route 0.0.0.0/0 172.31.1.1 eth0 tag 210 210
ip route 10.0.0.0/16 10.0.0.1 eth1 tag 210 210
ip route 10.0.0.1/32 eth1 tag 210 210
ip route 172.31.1.1/32 eth0 tag 210 210
!
line vty
!
end

sudo journalctl -b | grep dhcp:

Aug 16 04:04:48 debian vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:48 debian vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:52 vyos dhclient-script-vyos[1721]: Deleting nameservers with tag "dhcp-eth0" via vyos-hostsd-client
Aug 16 04:04:52 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth0"]}
Aug 16 04:04:52 vyos dhclient-script-vyos[1721]: Adding nameservers "213.133.99.99 213.133.100.100 213.133.98.98" with tag "dhcp-eth0" via vyos-hostsd-client
Aug 16 04:04:52 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth0": ["213.133.99.99", "213.133.100.100", "213.133.98.98"]}}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 15:03:26 vyos dhclient-script-vyos[6728]: Deleting nameservers with tag "dhcp-eth0" via vyos-hostsd-client
Aug 16 15:03:26 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth0"]}
Aug 16 15:03:26 vyos dhclient-script-vyos[6728]: Adding nameservers "213.133.99.99 213.133.100.100 213.133.98.98" with tag "dhcp-eth0" via vyos-hostsd-client
Aug 16 15:03:26 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth0": ["213.133.99.99", "213.133.100.100", "213.133.98.98"]}}
Aug 17 00:47:53 vyos dhclient-script-vyos[8349]: Deleting nameservers with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 00:47:53 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth0"]}
Aug 17 00:47:53 vyos dhclient-script-vyos[8349]: Adding nameservers "213.133.99.99 213.133.100.100 213.133.98.98" with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 00:47:53 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth0": ["213.133.99.99", "213.133.100.100", "213.133.98.98"]}}
Aug 17 11:30:18 vyos dhclient-script-vyos[8709]: Deleting nameservers with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 11:30:18 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth0"]}
Aug 17 11:30:18 vyos dhclient-script-vyos[8709]: Adding nameservers "213.133.99.99 213.133.100.100 213.133.98.98" with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 11:30:18 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth0": ["213.133.99.99", "213.133.100.100", "213.133.98.98"]}}
Aug 17 21:41:11 vyos dhclient-script-vyos[8995]: Deleting nameservers with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 21:41:11 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth0"]}
Aug 17 21:41:11 vyos dhclient-script-vyos[8995]: Adding nameservers "213.133.99.99 213.133.100.100 213.133.98.98" with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 21:41:11 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth0": ["213.133.99.99", "213.133.100.100", "213.133.98.98"]}}

Hi, @nikita.af!
The issue with the kernel routes most likely appears because of unreachable gateway addresses. So, we need to focus on gateways and interfaces addresses.
Are DHCP servers controlled by yourself, or this deployment is somewhere in the cloud or any other uncontrolled place? Also, can you please share the output of a bit different command, so we can see detailed DHCP logs: sudo journalctl -b | grep dhc (dhc without “p” at the end)?
I hope that when we will understand the environment and see extended logs, we can figure out if this is the wrong DHCP server configuration, missed functionality on the VyOS side, or something else.

Hi @zsdc,
gateway adress is reachable, thats the issue. I will provide all info requsted by you below but let’s check availability first:

vyos@vyos# ping 172.31.1.1
PING 172.31.1.1 (172.31.1.1) 56(84) bytes of data.
64 bytes from 172.31.1.1: icmp_seq=1 ttl=64 time=0.185 ms

ok, it works. Now let’s try to add a static route via vbash:

vyos@vyos# set protocols static route 1.1.1.1/32 next-hop 172.31.1.1
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# ip ro
default via 172.31.1.1 dev eth0 proto static metric 20 onlink
1.1.1.1 via 172.31.1.1 dev eth0 proto static metric 20 onlink
10.0.0.0/16 via 10.0.0.1 dev eth1 proto static metric 20 onlink
10.0.0.1 dev eth1 proto static metric 20
172.31.1.1 dev eth0 proto static metric 20
vyos@vyos# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=57 time=20.4 ms

Looks ok. Now I delete static route (delete protocols static) and let’s try to add same but as kernel route:

vyos@vyos:~$ ip ro
default via 172.31.1.1 dev eth0 proto static metric 20 onlink
10.0.0.0/16 via 10.0.0.1 dev eth1 proto static metric 20 onlink
10.0.0.1 dev eth1 proto static metric 20
172.31.1.1 dev eth0 proto static metric 20
vyos@vyos:~$ sudo ip ro add 1.1.1.1 via 172.31.1.1 dev eth0
Error: Nexthop has invalid gateway.
vyos@vyos:~$

Now about your questions:

Are DHCP servers controlled by yourself, or this deployment is somewhere in the cloud or any other uncontrolled place?

VyOS is deployed in Hetzner VPS (not a bare metal). DHCP is controlled by Hetzner.

Also, can you please share the output of a bit different command, so we can see detailed DHCP logs: sudo journalctl -b | grep dhc ( dhc without “p” at the end)?

Here it is:

vyos@vyos:~$ sudo journalctl -b | grep dhc
Aug 16 04:04:48 debian vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:48 debian vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:51 vyos sudo[1553]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/systemctl restart dhclient@eth1.service
Aug 16 04:04:51 vyos systemd[1]: Created slice system-dhclient.slice.
Aug 16 04:04:52 vyos dhclient-script-vyos[1567]: Current dhclient PID: 1560, Parent PID: 1555, IP version: -4, All dhclients for interface eth1: 1555 1560
Aug 16 04:04:52 vyos dhclient-script-vyos[1567]: Passing command to /usr/sbin/ip: "link set dev eth1 up"
Aug 16 04:04:52 vyos dhclient-script-vyos[1567]: No changes to apply via vyos-hostsd-client
Aug 16 04:04:52 vyos dhclient[1560]: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 6
Aug 16 04:04:52 vyos dhclient[1560]: DHCPOFFER of 10.0.0.3 from 10.0.0.1
Aug 16 04:04:52 vyos dhclient[1560]: DHCPREQUEST for 10.0.0.3 on eth1 to 255.255.255.255 port 67
Aug 16 04:04:52 vyos dhclient[1560]: DHCPACK of 10.0.0.3 from 10.0.0.1
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: Current dhclient PID: 1560, Parent PID: 1, IP version: -4, All dhclients for interface eth1: 1560
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: Passing command to /usr/sbin/ip: "-4 addr add 10.0.0.3/255.255.255.255 broadcast 10.0.0.3 valid_lft 86400 preferred_lft 86400 dev eth1 label eth1"
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: Passing command to /usr/sbin/ip: "link set dev eth1 mtu 1450"
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: No changes to apply via vyos-hostsd-client
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: No changes to apply via vyos-hostsd-client
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: FRR status: running
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: Checking if the route presented in kernel: 10.0.0.1/32 dev eth1
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: Converted vtysh command: "ip route 10.0.0.1/32  eth1 tag 210 210 "
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: Sending command to vtysh
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: FRR status: running
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: Checking if the route presented in kernel: 10.0.0.0/16 via 10.0.0.1 dev eth1
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: Converted vtysh command: "ip route 10.0.0.0/16 10.0.0.1 eth1 tag 210 210 "
Aug 16 04:04:52 vyos dhclient-script-vyos[1596]: Sending command to vtysh
Aug 16 04:04:52 vyos sudo[1681]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/systemctl restart dhclient@eth0.service
Aug 16 04:04:52 vyos dhclient-script-vyos[1686]: Current dhclient PID: 1685, Parent PID: 1683, IP version: -4, All dhclients for interface eth0: 1683 1685
Aug 16 04:04:52 vyos dhclient[1560]: bound to 10.0.0.3 -- renewal in 41300 seconds.
Aug 16 04:04:52 vyos dhclient-script-vyos[1686]: Passing command to /usr/sbin/ip: "link set dev eth0 up"
Aug 16 04:04:52 vyos dhclient-script-vyos[1686]: No changes to apply via vyos-hostsd-client
Aug 16 04:04:52 vyos dhclient[1685]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
Aug 16 04:04:52 vyos dhclient[1685]: DHCPOFFER of 95.216.215.168 from 172.31.1.1
Aug 16 04:04:52 vyos dhclient[1685]: DHCPREQUEST for 95.216.215.168 on eth0 to 255.255.255.255 port 67
Aug 16 04:04:52 vyos dhclient[1685]: DHCPACK of 95.216.215.168 from 172.31.1.1
Aug 16 04:04:52 vyos dhclient-script-vyos[1721]: Current dhclient PID: 1685, Parent PID: 1, IP version: -4, All dhclients for interface eth0: 1685
Aug 16 04:04:52 vyos dhclient-script-vyos[1721]: Passing command to /usr/sbin/ip: "-4 addr add 95.216.215.168/255.255.255.255 broadcast 95.216.215.168 valid_lft 86400 preferred_lft 86400 dev eth0 label eth0"
Aug 16 04:04:52 vyos dhclient-script-vyos[1721]: Deleting nameservers with tag "dhcp-eth0" via vyos-hostsd-client
Aug 16 04:04:52 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth0"]}
Aug 16 04:04:52 vyos dhclient-script-vyos[1721]: Adding nameservers "213.133.99.99 213.133.100.100 213.133.98.98" with tag "dhcp-eth0" via vyos-hostsd-client
Aug 16 04:04:52 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth0": ["213.133.99.99", "213.133.100.100", "213.133.98.98"]}}
Aug 16 04:04:52 vyos dhclient-script-vyos[1721]: Applying changes via vyos-hostsd-client
Aug 16 04:04:53 vyos dhclient-script-vyos[1721]: No changes to apply via vyos-hostsd-client
Aug 16 04:04:53 vyos dhclient-script-vyos[1721]: FRR status: running
Aug 16 04:04:53 vyos dhclient-script-vyos[1721]: Checking if the route presented in kernel: 172.31.1.1/32 dev eth0
Aug 16 04:04:53 vyos dhclient-script-vyos[1721]: Converted vtysh command: "ip route 172.31.1.1/32  eth0 tag 210 210 "
Aug 16 04:04:53 vyos dhclient-script-vyos[1721]: Sending command to vtysh
Aug 16 04:04:53 vyos dhclient-script-vyos[1721]: FRR status: running
Aug 16 04:04:53 vyos dhclient-script-vyos[1721]: Checking if the route presented in kernel: 0.0.0.0/0 via 172.31.1.1 dev eth0
Aug 16 04:04:53 vyos dhclient-script-vyos[1721]: Converted vtysh command: "ip route 0.0.0.0/0 172.31.1.1 eth0 tag 210 210 "
Aug 16 04:04:53 vyos dhclient-script-vyos[1721]: Sending command to vtysh
Aug 16 04:04:53 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:53 vyos dhclient[1685]: bound to 95.216.215.168 -- renewal in 39513 seconds.
Aug 16 04:04:53 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:53 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Sent response: {'data': ['system', 'dhcp-eth0', 'dhcpv6-eth0', 'dhcp-eth1', 'dhcpv6-eth1']}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "delete", "data": ["system", "dhcp-eth0", "dhcpv6-eth0", "dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth0", "dhcpv6-eth0"]}
Aug 16 04:04:54 vyos vyos-hostsd[599]: Request data: {"type": "name_server_tags_system", "op": "add", "data": ["dhcp-eth1", "dhcpv6-eth1"]}
Aug 16 15:03:26 vyos dhclient[1685]: DHCPREQUEST for 95.216.215.168 on eth0 to 172.31.1.1 port 67
Aug 16 15:03:26 vyos dhclient[1685]: DHCPACK of 95.216.215.168 from 172.31.1.1
Aug 16 15:03:26 vyos dhclient-script-vyos[6728]: Current dhclient PID: 1685, Parent PID: 1, IP version: -4, All dhclients for interface eth0: 1685
Aug 16 15:03:26 vyos dhclient-script-vyos[6728]: Passing command to /usr/sbin/ip: "-4 addr change 95.216.215.168/255.255.255.255 broadcast 95.216.215.168 valid_lft 86400 preferred_lft 86400 dev eth0 label eth0"
Aug 16 15:03:26 vyos dhclient-script-vyos[6728]: Deleting nameservers with tag "dhcp-eth0" via vyos-hostsd-client
Aug 16 15:03:26 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth0"]}
Aug 16 15:03:26 vyos dhclient-script-vyos[6728]: Adding nameservers "213.133.99.99 213.133.100.100 213.133.98.98" with tag "dhcp-eth0" via vyos-hostsd-client
Aug 16 15:03:26 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth0": ["213.133.99.99", "213.133.100.100", "213.133.98.98"]}}
Aug 16 15:03:26 vyos dhclient-script-vyos[6728]: Applying changes via vyos-hostsd-client
Aug 16 15:03:26 vyos dhclient-script-vyos[6728]: No changes to apply via vyos-hostsd-client
Aug 16 15:03:26 vyos dhclient[1685]: bound to 95.216.215.168 -- renewal in 35067 seconds.
Aug 16 15:33:12 vyos dhclient[1560]: DHCPREQUEST for 10.0.0.3 on eth1 to 10.0.0.1 port 67
Aug 16 15:33:12 vyos dhclient[1560]: DHCPACK of 10.0.0.3 from 10.0.0.1
Aug 16 15:33:12 vyos dhclient-script-vyos[6775]: Current dhclient PID: 1560, Parent PID: 1, IP version: -4, All dhclients for interface eth1: 1560
Aug 16 15:33:12 vyos dhclient-script-vyos[6775]: Replacing MTU value for eth1 with preconfigured one: 1450
Aug 16 15:33:12 vyos dhclient-script-vyos[6775]: Passing command to /usr/sbin/ip: "-4 addr change 10.0.0.3/255.255.255.255 broadcast 10.0.0.3 valid_lft 86400 preferred_lft 86400 dev eth1 label eth1"
Aug 16 15:33:12 vyos dhclient-script-vyos[6775]: No changes to apply via vyos-hostsd-client
Aug 16 15:33:12 vyos dhclient-script-vyos[6775]: No changes to apply via vyos-hostsd-client
Aug 16 15:33:12 vyos dhclient[1560]: bound to 10.0.0.3 -- renewal in 40099 seconds.
Aug 17 00:47:53 vyos dhclient[1685]: DHCPREQUEST for 95.216.215.168 on eth0 to 172.31.1.1 port 67
Aug 17 00:47:53 vyos dhclient[1685]: DHCPACK of 95.216.215.168 from 172.31.1.1
Aug 17 00:47:53 vyos dhclient-script-vyos[8349]: Current dhclient PID: 1685, Parent PID: 1, IP version: -4, All dhclients for interface eth0: 1685
Aug 17 00:47:53 vyos dhclient-script-vyos[8349]: Passing command to /usr/sbin/ip: "-4 addr change 95.216.215.168/255.255.255.255 broadcast 95.216.215.168 valid_lft 86400 preferred_lft 86400 dev eth0 label eth0"
Aug 17 00:47:53 vyos dhclient-script-vyos[8349]: Deleting nameservers with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 00:47:53 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth0"]}
Aug 17 00:47:53 vyos dhclient-script-vyos[8349]: Adding nameservers "213.133.99.99 213.133.100.100 213.133.98.98" with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 00:47:53 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth0": ["213.133.99.99", "213.133.100.100", "213.133.98.98"]}}
Aug 17 00:47:53 vyos dhclient-script-vyos[8349]: Applying changes via vyos-hostsd-client
Aug 17 00:47:53 vyos dhclient-script-vyos[8349]: No changes to apply via vyos-hostsd-client
Aug 17 00:47:53 vyos dhclient[1685]: bound to 95.216.215.168 -- renewal in 38544 seconds.
Aug 17 02:41:31 vyos dhclient[1560]: DHCPREQUEST for 10.0.0.3 on eth1 to 10.0.0.1 port 67
Aug 17 02:41:31 vyos dhclient[1560]: DHCPACK of 10.0.0.3 from 10.0.0.1
Aug 17 02:41:31 vyos dhclient-script-vyos[8426]: Current dhclient PID: 1560, Parent PID: 1, IP version: -4, All dhclients for interface eth1: 1560
Aug 17 02:41:31 vyos dhclient-script-vyos[8426]: Replacing MTU value for eth1 with preconfigured one: 1450
Aug 17 02:41:31 vyos dhclient-script-vyos[8426]: Passing command to /usr/sbin/ip: "-4 addr change 10.0.0.3/255.255.255.255 broadcast 10.0.0.3 valid_lft 86400 preferred_lft 86400 dev eth1 label eth1"
Aug 17 02:41:31 vyos dhclient-script-vyos[8426]: No changes to apply via vyos-hostsd-client
Aug 17 02:41:31 vyos dhclient-script-vyos[8426]: No changes to apply via vyos-hostsd-client
Aug 17 02:41:31 vyos dhclient[1560]: bound to 10.0.0.3 -- renewal in 40527 seconds.
Aug 17 11:30:17 vyos dhclient[1685]: DHCPREQUEST for 95.216.215.168 on eth0 to 172.31.1.1 port 67
Aug 17 11:30:17 vyos dhclient[1685]: DHCPACK of 95.216.215.168 from 172.31.1.1
Aug 17 11:30:17 vyos dhclient-script-vyos[8709]: Current dhclient PID: 1685, Parent PID: 1, IP version: -4, All dhclients for interface eth0: 1685
Aug 17 11:30:17 vyos dhclient-script-vyos[8709]: Passing command to /usr/sbin/ip: "-4 addr change 95.216.215.168/255.255.255.255 broadcast 95.216.215.168 valid_lft 86400 preferred_lft 86400 dev eth0 label eth0"
Aug 17 11:30:18 vyos dhclient-script-vyos[8709]: Deleting nameservers with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 11:30:18 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth0"]}
Aug 17 11:30:18 vyos dhclient-script-vyos[8709]: Adding nameservers "213.133.99.99 213.133.100.100 213.133.98.98" with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 11:30:18 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth0": ["213.133.99.99", "213.133.100.100", "213.133.98.98"]}}
Aug 17 11:30:18 vyos dhclient-script-vyos[8709]: Applying changes via vyos-hostsd-client
Aug 17 11:30:18 vyos dhclient-script-vyos[8709]: No changes to apply via vyos-hostsd-client
Aug 17 11:30:18 vyos dhclient[1685]: bound to 95.216.215.168 -- renewal in 36653 seconds.
Aug 17 13:56:58 vyos dhclient[1560]: DHCPREQUEST for 10.0.0.3 on eth1 to 10.0.0.1 port 67
Aug 17 13:56:58 vyos dhclient[1560]: DHCPACK of 10.0.0.3 from 10.0.0.1
Aug 17 13:56:58 vyos dhclient-script-vyos[8796]: Current dhclient PID: 1560, Parent PID: 1, IP version: -4, All dhclients for interface eth1: 1560
Aug 17 13:56:58 vyos dhclient-script-vyos[8796]: Replacing MTU value for eth1 with preconfigured one: 1450
Aug 17 13:56:58 vyos dhclient-script-vyos[8796]: Passing command to /usr/sbin/ip: "-4 addr change 10.0.0.3/255.255.255.255 broadcast 10.0.0.3 valid_lft 86400 preferred_lft 86400 dev eth1 label eth1"
Aug 17 13:56:58 vyos dhclient-script-vyos[8796]: No changes to apply via vyos-hostsd-client
Aug 17 13:56:58 vyos dhclient-script-vyos[8796]: No changes to apply via vyos-hostsd-client
Aug 17 13:56:58 vyos dhclient[1560]: bound to 10.0.0.3 -- renewal in 33853 seconds.
Aug 17 21:41:11 vyos dhclient[1685]: DHCPREQUEST for 95.216.215.168 on eth0 to 172.31.1.1 port 67
Aug 17 21:41:11 vyos dhclient[1685]: DHCPACK of 95.216.215.168 from 172.31.1.1
Aug 17 21:41:11 vyos dhclient-script-vyos[8995]: Current dhclient PID: 1685, Parent PID: 1, IP version: -4, All dhclients for interface eth0: 1685
Aug 17 21:41:11 vyos dhclient-script-vyos[8995]: Passing command to /usr/sbin/ip: "-4 addr change 95.216.215.168/255.255.255.255 broadcast 95.216.215.168 valid_lft 86400 preferred_lft 86400 dev eth0 label eth0"
Aug 17 21:41:11 vyos dhclient-script-vyos[8995]: Deleting nameservers with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 21:41:11 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth0"]}
Aug 17 21:41:11 vyos dhclient-script-vyos[8995]: Adding nameservers "213.133.99.99 213.133.100.100 213.133.98.98" with tag "dhcp-eth0" via vyos-hostsd-client
Aug 17 21:41:11 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth0": ["213.133.99.99", "213.133.100.100", "213.133.98.98"]}}
Aug 17 21:41:11 vyos dhclient-script-vyos[8995]: Applying changes via vyos-hostsd-client
Aug 17 21:41:11 vyos dhclient-script-vyos[8995]: No changes to apply via vyos-hostsd-client
Aug 17 21:41:11 vyos dhclient[1685]: bound to 95.216.215.168 -- renewal in 33749 seconds.
Aug 17 23:21:11 vyos dhclient[1560]: DHCPREQUEST for 10.0.0.3 on eth1 to 10.0.0.1 port 67
Aug 17 23:21:11 vyos dhclient[1560]: DHCPACK of 10.0.0.3 from 10.0.0.1
Aug 17 23:21:11 vyos dhclient-script-vyos[9517]: Current dhclient PID: 1560, Parent PID: 1, IP version: -4, All dhclients for interface eth1: 1560
Aug 17 23:21:11 vyos dhclient-script-vyos[9517]: Replacing MTU value for eth1 with preconfigured one: 1450
Aug 17 23:21:11 vyos dhclient-script-vyos[9517]: Passing command to /usr/sbin/ip: "-4 addr change 10.0.0.3/255.255.255.255 broadcast 10.0.0.3 valid_lft 86400 preferred_lft 86400 dev eth1 label eth1"
Aug 17 23:21:11 vyos dhclient-script-vyos[9517]: No changes to apply via vyos-hostsd-client
Aug 17 23:21:11 vyos dhclient-script-vyos[9517]: No changes to apply via vyos-hostsd-client
Aug 17 23:21:11 vyos dhclient[1560]: bound to 10.0.0.3 -- renewal in 36384 seconds.
Aug 18 07:03:40 vyos dhclient[1685]: DHCPREQUEST for 95.216.215.168 on eth0 to 172.31.1.1 port 67
Aug 18 07:03:40 vyos dhclient[1685]: DHCPACK of 95.216.215.168 from 172.31.1.1
Aug 18 07:03:40 vyos dhclient-script-vyos[9801]: Current dhclient PID: 1685, Parent PID: 1, IP version: -4, All dhclients for interface eth0: 1685
Aug 18 07:03:40 vyos dhclient-script-vyos[9801]: Passing command to /usr/sbin/ip: "-4 addr change 95.216.215.168/255.255.255.255 broadcast 95.216.215.168 valid_lft 86400 preferred_lft 86400 dev eth0 label eth0"
Aug 18 07:03:40 vyos dhclient-script-vyos[9801]: Deleting nameservers with tag "dhcp-eth0" via vyos-hostsd-client
Aug 18 07:03:40 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "delete", "data": ["dhcp-eth0"]}
Aug 18 07:03:40 vyos dhclient-script-vyos[9801]: Adding nameservers "213.133.99.99 213.133.100.100 213.133.98.98" with tag "dhcp-eth0" via vyos-hostsd-client
Aug 18 07:03:40 vyos vyos-hostsd[599]: Request data: {"type": "name_servers", "op": "add", "data": {"dhcp-eth0": ["213.133.99.99", "213.133.100.100", "213.133.98.98"]}}
Aug 18 07:03:40 vyos dhclient-script-vyos[9801]: Applying changes via vyos-hostsd-client
Aug 18 07:03:40 vyos dhclient-script-vyos[9801]: No changes to apply via vyos-hostsd-client
Aug 18 07:03:40 vyos dhclient[1685]: bound to 95.216.215.168 -- renewal in 39722 seconds.
Aug 18 09:27:35 vyos dhclient[1560]: DHCPREQUEST for 10.0.0.3 on eth1 to 10.0.0.1 port 67
Aug 18 09:27:35 vyos dhclient[1560]: DHCPACK of 10.0.0.3 from 10.0.0.1
Aug 18 09:27:35 vyos dhclient-script-vyos[9890]: Current dhclient PID: 1560, Parent PID: 1, IP version: -4, All dhclients for interface eth1: 1560
Aug 18 09:27:36 vyos dhclient-script-vyos[9890]: Replacing MTU value for eth1 with preconfigured one: 1450
Aug 18 09:27:36 vyos dhclient-script-vyos[9890]: Passing command to /usr/sbin/ip: "-4 addr change 10.0.0.3/255.255.255.255 broadcast 10.0.0.3 valid_lft 86400 preferred_lft 86400 dev eth1 label eth1"
Aug 18 09:27:36 vyos dhclient-script-vyos[9890]: No changes to apply via vyos-hostsd-client
Aug 18 09:27:36 vyos dhclient-script-vyos[9890]: No changes to apply via vyos-hostsd-client
Aug 18 09:27:36 vyos dhclient[1560]: bound to 10.0.0.3 -- renewal in 39395 seconds.
vyos@vyos:~$

And one more check @zsdc. I just deployed another VPS in Hetzner. OS is Debian 10. I didn’t do any configuration on the server. Let’s try same trick here.

root@debian-2gb-hel1-1:~# ip ro
default via 172.31.1.1 dev eth0
172.31.1.1 dev eth0 scope link
root@debian-2gb-hel1-1:~# ip ro add 1.1.1.1 via 172.31.1.1
root@debian-2gb-hel1-1:~# ip ro
default via 172.31.1.1 dev eth0
1.1.1.1 via 172.31.1.1 dev eth0
172.31.1.1 dev eth0 scope link
root@debian-2gb-hel1-1:~# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=57 time=20.2 ms
^C

Thanks, @nikita.af!
In your case, to add the route, you need the magic option “onlink”:

sudo ip route add 1.1.1.1 via 172.31.1.1 dev eth0 proto static onlink

Or use the vtysh, which should handle this:

sudo vtysh
conf t
ip route 1.1.1.1/32 172.31.1.1 eth0

Or, the native CLI:

set protocols static route 1.1.1.1/32 next-hop 172.31.1.1 next-hop-interface 'eth0'
1 Like

Thanks @zsdc. That works!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.