Page MenuHomeVyOS Platform

Static routes ignored with DHCP received gateway
Closed, ResolvedPublicBUG

Description

Hi!

I have noticed a behavior on the latest preview builds. Basically, what happens is despite the static default route being there in vyos configuration, the system ignores it entirely and defaults to the DHCP received default route(s). This was not a problem in the 1.1.x builds, or 1.2.0-beta1 (squeeze Lithium beta).

Example of my usual configuration:

show protocols static
 route 0.0.0.0/0 {
     next-hop 172.0.0.1 {
         distance 5
     }
     next-hop 172.1.0.1 {
         distance 1
     }

which would generate...

S   0.0.0.0/0 [5/0] via 172.0.0.1
S>* 0.0.0.0/0 [1/0] via 172.1.0.1, eth1

However, on the latest preview build, even when the configuration is there, the system defaults to both ending up as equal cost routes with the default DHCP route distance.

S   0.0.0.0/0 [210/0] via 172.0.0.1
                      via 172.1.0.1

Obviously, while this can be fixed manually by re-configuring the static routes thereafter, this has to be done every boot and is thus not ideal.

Hope this can be fixed. Pleased to be of any further assistance.

Thanks.

Details

Difficulty level
Normal (likely a few hours)
Version
1.2.0-rc1
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

syncer lowered the priority of this task from Unbreak Now! to Normal.Nov 5 2016, 12:23 PM

@EwaldvanGeffen can you check this one
Thanks!

Maybe you can resolve with this method.

I did not test

touch /etc/dhcp/dhclient-enter-hooks.d/no-rfc3442-classless-routes

ACTION="on" # on/off 

if [ "$ACTION" = "on" ]; then
    if [ -n "$new_rfc3442_classless_static_routes" ]; then
        case $reason in
            BOUND|RENEW|REBIND|REBOOT)
                 unset new_rfc3442_classless_static_routes
            ;;
        esac
    fi
fi

ignore default route

touch /etc/dhcp/dhclient-enter-hooks.d/no-default-route

ACTION="on" # on/off

if [ "$ACTION" = "on" ]; then
    if [ -n "$new_routers" ]; then
        case $reason in
            BOUND|RENEW|REBIND|REBOOT)
                 unset new_routers
             ;;
        esac
    fi
fi

Maybe you can resolve with this method.

I did not test

That works pretty well :) . I was thinking that there could be a possibility of using DHCP without an injected static route to solve this as well? e.g. set interfaces ethernet ethX address dhcp [no-static] option that could retrieve just the address and disable installing the static route into the system.

I actually looked at the issue again, and realised that even on VyOS 1.1.7 this issue exists if there is more than 1 DHCP interface enabled. Basically, the system will ignore what was set for the admin distance and re-set to default admin distance (210) for the second DHCP interface onwards.

syncer changed the subtype of this task from "Task" to "Bug".Oct 18 2018, 5:52 AM

This bug can't be reproduced in 1.2.0-LTS and 1.2.0-rolling+201902080337, so seems that it was fixed in some of previous releases. Closing ticket.
Feel free to reopen it if the the same behavior will be spotted in one of current releases.

dmbaturin set Why the issue appeared? to Will be filled on close.Sep 3 2021, 7:16 AM
dmbaturin set Is it a breaking change? to Unspecified (possibly destroys the router).
dmbaturin set Issue type to Bug (incorrect behavior).