Static Routes Added to Configuration but Not Applied

Hello VyOS Community,

I’m encountering an issue where static routes are added to the configuration but do not appear to be applied to the routing table. Below are the key details:

Issue: Some static routes show up in the configuration but are missing in the show ip route and ip route outputs.

I’ve already checked the following:

  • The static route syntax in the configuration file.
  • Any conflicting configurations, such as overlapping routes or firewalls.

If anyone has insights into why these routes might not be applied or steps for debugging further, I’d appreciate your guidance.

Thanks in advance for your help!

WAN

set load-balancing wan enable-local-traffic
set load-balancing wan flush-connections
set load-balancing wan interface-health pppoe0 failure-count '1'
set load-balancing wan interface-health pppoe0 nexthop 'L1IPADDRESS'
set load-balancing wan interface-health pppoe0 success-count '10'
set load-balancing wan interface-health pppoe1 failure-count '1'
set load-balancing wan interface-health pppoe1 nexthop 'L2IPADDRESS'
set load-balancing wan interface-health pppoe1 success-count '10'
set load-balancing wan rule 1 inbound-interface 'br0'
set load-balancing wan rule 1 interface pppoe0 weight '1'
set load-balancing wan rule 1 interface pppoe1 weight '2'
set load-balancing wan rule 1 protocol 'all'
set load-balancing wan rule 2 destination address 'D1IPAddress/32'
set load-balancing wan rule 2 exclude
set load-balancing wan rule 2 inbound-interface 'any'
set load-balancing wan rule 3 destination address 'D2IPAddress/32'
set load-balancing wan rule 3 exclude
set load-balancing wan rule 3 inbound-interface 'any'
set load-balancing wan rule 7 destination address 'D3IPAddress/32'
set load-balancing wan rule 7 exclude
set load-balancing wan rule 7 inbound-interface 'any'
set load-balancing wan rule 7 protocol 'all'
set load-balancing wan rule 8 destination address '172.16.0.0/12'
set load-balancing wan rule 8 failover
set load-balancing wan rule 8 inbound-interface 'any'
set load-balancing wan rule 8 interface vti10 weight '10'
set load-balancing wan rule 8 interface vti20 weight '1'
set load-balancing wan rule 8 protocol 'all'
set load-balancing wan sticky-connections inbound

Static

set protocols static route 10.0.28.2/32 interface vti30
set protocols static route 10.99.2.202/32 interface vti10 distance '200'
set protocols static route 10.99.2.202/32 interface vti20
set protocols static route 172.16.0.0/12 interface vti10 distance '200'
set protocols static route 172.16.0.0/12 interface vti20
set protocols static route D1IPAddress/32 interface pppoe0
set protocols static route D2IPAddress/32 interface pppoe1
set protocols static route D2IPAddress/32 next-hop 177.23.28.6
set protocols static route D3IPAddress/32 interface vti10 distance '200'
set protocols static route D3IPAddress/32 interface vti20
set protocols static route D4IPAddress/32 interface vti10 distance '200'
set protocols static route D4IPAddress/32 interface vti20
set protocols static route D5IPAddress/32 interface vti10 distance '200'
set protocols static route D5IPAddress/32 interface vti20
set protocols static route D6IPAddress/32 interface vti10 distance '200'
set protocols static route D6IPAddress/32 interface vti20
set protocols static route D7IPAddress/32 interface vti10 distance '200'
set protocols static route D7IPAddress/32 interface vti20

VyOS Ver

Version:          VyOS 1.5-rolling-202412310006
Release train:    current
Release flavor:   generic

Built by:         [email protected]
Built on:         Tue 31 Dec 2024 00:07 UTC
Build UUID:       dc752092-6cfd-46ae-80ad-97c9f5c98503
Build commit ID:  d6fab6c8c03699

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

Hi,

This issue might happen if the interfaces tied to your static routes are down or if the next-hop IPs aren’t reachable. It’s worth checking the status of your interfaces (show interfaces) and verifying that the next-hops can be pinged. Another thing to consider is the administrative distance—VyOS will only apply the route with the lowest distance if there are conflicts.

Your WAN load-balancing rules might also play a role here, as they could override or conflict with the static routes. You could review those settings with show load-balancing wan to see if anything stands out.

Hi @son,
Did an upgrade today and got the log below when trying to adjust the static rules.

Jan 05 14:33:44 vyos-configd[10723]: VyOS had an issue completing a command.
Jan 05 14:33:44 vyos-configd[10723]: We are sorry that you encountered a problem while using VyOS.
Jan 05 14:33:44 vyos-configd[10723]: There are a few things you can do to help us (and yourself):
Jan 05 14:33:44 vyos-configd[10723]: - Contact us using the online help desk if you have a subscription:
Jan 05 14:33:44 vyos-configd[10723]:   https://support.vyos.io/
Jan 05 14:33:44 vyos-configd[10723]: - Make sure you are running the latest version of VyOS available at:
Jan 05 14:33:44 vyos-configd[10723]:   https://vyos.net/get/
Jan 05 14:33:44 vyos-configd[10723]: - Consult the community forum to see how to handle this issue:
Jan 05 14:33:44 vyos-configd[10723]:   https://forum.vyos.io
Jan 05 14:33:44 vyos-configd[10723]: - Join us on Slack where our users exchange help and advice:
Jan 05 14:33:44 vyos-configd[10723]:   https://vyos.slack.com
Jan 05 14:33:44 vyos-configd[10723]: When reporting problems, please include as much information as possible:
Jan 05 14:33:44 vyos-configd[10723]: - do not obfuscate any data (feel free to contact us privately if your
Jan 05 14:33:44 vyos-configd[10723]:   business policy requires it)
Jan 05 14:33:44 vyos-configd[10723]: - and include all the information presented below
Jan 05 14:33:44 vyos-configd[10723]: Report time:      2025-01-05 14:33:44
Jan 05 14:33:44 vyos-configd[10723]: Image version:    VyOS 1.5-rolling-202501050641
Jan 05 14:33:44 vyos-configd[10723]: Release train:    current
Jan 05 14:33:44 vyos-configd[10723]: Built by:         [email protected]
Jan 05 14:33:44 vyos-configd[10723]: Built on:         Sun 05 Jan 2025 06:41 UTC
Jan 05 14:33:44 vyos-configd[10723]: Build UUID:       63e79d4b-9815-4c6b-81d0-7012516424eb
Jan 05 14:33:44 vyos-configd[10723]: Build commit ID:  aa4ba3d95e162f
Jan 05 14:33:44 vyos-configd[10723]: Architecture:     x86_64
Jan 05 14:33:44 vyos-configd[10723]: Boot via:         installed image
Jan 05 14:33:44 vyos-configd[10723]: System type:      bare metal
Jan 05 14:33:44 vyos-configd[10723]: Hardware vendor:  Techvision
Jan 05 14:33:44 vyos-configd[10723]: Hardware model:   TVI7309X
Jan 05 14:33:44 vyos-configd[10723]: Hardware S/N:     Default string
Jan 05 14:33:44 vyos-configd[10723]: Hardware UUID:    03000200-0400-0500-0006-000700080009
Jan 05 14:33:44 vyos-configd[10723]: Traceback (most recent call last):
Jan 05 14:33:44 vyos-configd[10723]:   File "/usr/libexec/vyos/services/vyos-configd", line 339, in <module>
Jan 05 14:33:44 vyos-configd[10723]:     frrender_cls.apply()
Jan 05 14:33:44 vyos-configd[10723]:   File "/usr/lib/python3/dist-packages/vyos/frrender.py", line 684, in apply
Jan 05 14:33:44 vyos-configd[10723]:     raise ConfigError(emsg)
Jan 05 14:33:44 vyos-configd[10723]: vyos.base.ConfigError: vtysh failed to process new configuration: vtysh (mark file) exited with
Jan 05 14:33:44 vyos-configd[10723]: status 2: b'line 26: % Unknown command: ip  route 0.0.0.0/0 pppoe0 tag
Jan 05 14:33:44 vyos-configd[10723]: 210 1ip  route 0.0.0.0/0 pppoe1 tag 210 1!\n\n'
Jan 05 14:33:44 python3[10723]: Report time:      2025-01-05 14:33:44
Jan 05 14:33:44 python3[10723]: Image version:    VyOS 1.5-rolling-202501050641
Jan 05 14:33:44 python3[10723]: Release train:    current
Jan 05 14:33:44 python3[10723]: Built by:         [email protected]
Jan 05 14:33:44 python3[10723]: Built on:         Sun 05 Jan 2025 06:41 UTC
Jan 05 14:33:44 python3[10723]: Build UUID:       63e79d4b-9815-4c6b-81d0-7012516424eb
Jan 05 14:33:44 python3[10723]: Build commit ID:  aa4ba3d95e162f
Jan 05 14:33:44 Architecture[10723]:     x86_64
Jan 05 14:33:44 python3[10723]: Boot via:         installed image
Jan 05 14:33:44 python3[10723]: System type:      bare metal
Jan 05 14:33:44 python3[10723]: Hardware vendor:  Techvision
Jan 05 14:33:44 python3[10723]: Hardware model:   TVI7309X
Jan 05 14:33:44 python3[10723]: Hardware S/N:     Default string
Jan 05 14:33:44 python3[10723]: Hardware UUID:    03000200-0400-0500-0006-000700080009
Jan 05 14:33:44 python3[10723]: Traceback (most recent call last):
Jan 05 14:33:44 python3[10723]:   File "/usr/libexec/vyos/services/vyos-configd", line 339, in <module>
Jan 05 14:33:44 python3[10723]:     frrender_cls.apply()
Jan 05 14:33:44 python3[10723]:   File "/usr/lib/python3/dist-packages/vyos/frrender.py", line 684, in apply
Jan 05 14:33:44 python3[10723]:     raise ConfigError(emsg)
Jan 05 14:33:44 vyos.base.ConfigError[10723]: vtysh failed to process new configuration: vtysh (mark file) exited with
Jan 05 14:33:44 python3[10723]: status 2: b'line 26: % Unknown command: ip  route 0.0.0.0/0 pppoe0 tag
Jan 05 14:33:44 python3[10723]: 210 1ip  route 0.0.0.0/0 pppoe1 tag 210 1!\n\n'
Jan 05 14:33:44 systemd[1]: vyos-configd.service: Main process exited, code=exited, status=1/FAILURE
Jan 05 14:33:44 systemd[1]: vyos-configd.service: Failed with result 'exit-code'.
Jan 05 14:33:44 systemd[1]: vyos-configd.service: Consumed 1.244s CPU time.
Jan 05 14:33:44 systemd[1]: vyos-configd.service: Scheduled restart job, restart counter is at 5.
Jan 05 14:33:44 systemd[1]: Stopped vyos-configd.service - VyOS configuration daemon.
Jan 05 14:33:44 systemd[1]: vyos-configd.service: Consumed 1.244s CPU time.
Jan 05 14:33:44 systemd[1]: Started vyos-configd.service - VyOS configuration daemon.

Routes

set protocols static route 10.0.28.2/32 interface vti30
set protocols static route 10.99.2.202/32 interface vti10
set protocols static route 172.20.0.12/32 interface vti10
set protocols static route D1IPAddress/32 interface pppoe0
set protocols static route D2IPAddress/32 interface pppoe1
set protocols static route D2IPAddress/32 next-hop D2IPNextHop
set protocols static route D3IPAddress/32 interface vti10
set protocols static route D4IPAddress/32 interface vti10
set protocols static route D5IPAddress/32 interface vti10
set protocols static route D6IPAddress/32 interface vti10
set protocols static route D7IPAddress/32 interface vti10```