Default route desappears

.
When I run the command show ip route in R1, I get the routing table where there is an outbound static route that seems like this:

S>* 0.0.0.0/0 [210/0] via 10.0.2.2, eth0, weight 1, 00:14:00

It’s the interface eth0 that was set as dhcp address with the following command:

set interfaces ethernet eth0 address dhcp

R1 have an interface that belongs to the network 10.0.0.8/30. Its a point-to-point network where the .10 IP address belongs to the R1 interface and the .9 is the IP address from the R2 interface. The 192.168.10.0/24 it’s a stub network behind R2.

But when I add other static route in R1 whit the following command:

set protocols static route 192.168.10.0/24 next-hop 10.0.0.9

the outbound static route desapears. It seems that was replace by the static route previous set up:

S>* 192.168.10.0/24 [1/0] via 10.0.0.9, eth2, weight 1, 00:23:35

I had to set up the eth0 interface again in order to the activate the outbound static route.
What can I do to prevent the outbound static route from disappearing whenever I add another static route? Thanks

This is not expected behaviour.
What vyos version is running on R1?

First of all I’m runnig Vyos in a Virtualbox environment (6.1 version). The Vyos version is the following:

Version: VyOS 1.4-rolling-202109191513
Release train: sagitta

Built by: autobuild@vyos.net
Built on: Sun 19 Sep 2021 15:13 UTC
Build UUID: 6837bfa3-73ca-4621-abca-522358e9eec3
Build commit ID: 07555c06452524

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

Hardware vendor: innotek GmbH
Hardware model: VirtualBox
Hardware S/N: 0
Hardware UUID: 5724069e-fa30-db4f-a902-6bbdafffd7e0

Copyright: VyOS maintainers and contributors

In R1 I also have a NAT configuration :

source {
rule 10 {
outbound-interface eth0
source {
address 10.0.0.0/24
}
translation {
address masquerade
} } }

The complete table routing at the moment is:

S>* 0.0.0.0/0 [210/0] via 10.0.2.2, eth0, weight 1, 04:27:32
C>* 10.0.0.0/29 is directly connected, eth1, 04:37:12
C>* 10.0.0.8/30 is directly connected, eth2, 04:37:10
R>* 10.0.0.16/29 [120/2] via 10.0.0.9, eth2, weight 1, 04:36:35
R>* 10.0.0.24/29 [120/2] via 10.0.0.9, eth2, weight 1, 04:36:35
R>* 10.0.0.32/30 [120/2] via 10.0.0.57, eth3, weight 1, 04:36:53
R>* 10.0.0.40/29 [120/2] via 10.0.0.57, eth3, weight 1, 04:36:53
R>* 10.0.0.48/29 [120/2] via 10.0.0.57, eth3, weight 1, 04:36:53
C>* 10.0.0.56/30 is directly connected, eth3, 04:37:11
C>* 10.0.2.0/24 is directly connected, eth0, 04:27:32
S>* 192.168.10.0/24 [1/0] via 10.0.0.57, eth3, weight 1, 04:37:07
S>* 192.168.200.0/24 [1/0] via 10.0.0.9, eth2, weight 1, 04:37:07

And the RIP is the following:

Network            Next Hop         Metric From            Tag Time

C(i) 10.0.0.0/29 0.0.0.0 1 self 0
C(i) 10.0.0.8/30 0.0.0.0 1 self 0
R(n) 10.0.0.16/29 10.0.0.9 2 10.0.0.9 0 02:32
R(n) 10.0.0.24/29 10.0.0.9 2 10.0.0.9 0 02:32
R(n) 10.0.0.32/30 10.0.0.57 2 10.0.0.57 0 02:40
R(n) 10.0.0.40/29 10.0.0.57 2 10.0.0.57 0 02:40
R(n) 10.0.0.48/29 10.0.0.57 2 10.0.0.57 0 02:40
C(i) 10.0.0.56/30 0.0.0.0 1 self 0

does route really disappear, or does it have to do with administrative distance.
DHCP learned route has AD 210, which is worse than 1 on static route.
You could play around with AD on default static route (set it to 210 or 211, and post results)

I deleted the static routes, except the outbound static route. The routing table it stayed like this:

S>* 0.0.0.0/0 [210/0] via 10.0.2.2, eth0, weight 1, 00:03:25
C>* 10.0.0.0/29 is directly connected, eth1, 00:07:04
C>* 10.0.0.8/30 is directly connected, eth2, 00:07:03
C>* 10.0.0.56/30 is directly connected, eth3, 00:07:03
C>* 10.0.2.0/24 is directly connected, eth0, 00:03:25

Then I created a static route again with the following command:

set protocols static route 192.168.200.0/24 next-hop 10.0.0.9 distance 211

But, again the outbound static route desappears :

C>* 10.0.0.0/29 is directly connected, eth1, 00:08:38
C>* 10.0.0.8/30 is directly connected, eth2, 00:08:37
C>* 10.0.0.56/30 is directly connected, eth3, 00:08:37
C>* 10.0.2.0/24 is directly connected, eth0, 00:04:59
S>* 192.168.200.0/24 [211/0] via 10.0.0.9, eth3, weight 1, 00:00:12

When I run the command show ip route 0.0.0.0/0 there’s no results.

Can you try newer version? I could reproduce error in vyos-1.4-rolling-202109240217, but on version VyOS 1.4-rolling-202202150317 is working as expected.

I’ve installed the following version of Vyos:

 Preformatted text`Version:   VyOS 1.4-rolling-202203020319
 Release train:    sagitta
 Built by:         autobuild@vyos.net
 Built on:         Wed 02 Mar 2022 03:19 UTC
 Build UUID:       fc8df8a1-d041-428d-9d6a-af5bd694fc5e
 Build commit ID:  ffd49c134ca9ef
 Architecture:     x86_64
 Boot via:         installed image
 System type:      KVM guest
 Hardware vendor:  innotek GmbH
 Hardware model:   VirtualBox
 Hardware S/N:     0
 Hardware UUID:    9533856f-1817-af41-a6d9-d1847e389969
 Copyright:        VyOS maintainers and contributors

And now is working. The outbound static route stays on even after I set up onother static route. Thank you for the help.

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