Page MenuHomePhabricator

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
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 edited subscribers, added: VyOS 1.2 Crux; removed: syncer, VyOS 1.1.x (1.1.8), EwaldvanGeffen.
pasik added a subscriber: pasik.Oct 1 2018, 9:54 AM
dmbaturin set Version to 1.2.0-rc1.
syncer assigned this task to dmbaturin.Oct 13 2018, 7:28 PM
syncer changed the subtype of this task from "Task" to "Bug".Oct 18 2018, 5:52 AM
syncer reassigned this task from dmbaturin to zsdc.
syncer added a subscriber: dmbaturin.
zsdc closed this task as Resolved.Feb 8 2019, 1:23 PM

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.