Page MenuHomePhabricator

Static route syntax should reflect `ip` command routing capabilities, if possible.
Open, WishlistPublicFEATURE REQUEST

Description

The ip command is capable of adding routes to the table that simultaneously define the next-hop and interface.
The current set protocols static route, set protocols static interface-route , and their respective IPv6 sister commands do not reflect this capability. Attempting to use both of these command sets at once causes weird routing table entries, while ip works as expected.

I suggest the following syntax:

set protocols static route <CIDR> next-hop <ADDR>/blackhole
set protocols static route <CIDR> interface <DEV>
set protocols static route <CIDR> distance <1-255>
set protocols static route <CIDR> dhcp-interface
set protocols static route <CIDR> disable

or

set protocols static route <CIDR> next-hop <ADDR>
set protocols static route <CIDR> interface <DEV>
set protocols static route <CIDR> distance <1-255>
set protocols static route <CIDR> dhcp-interface
set protocols static route <CIDR> status blackhole
set protocols static route <CIDR> status disable

or

set protocols static route <CIDR> next-hop <ADDR>
set protocols static route <CIDR> interface <DEV>
set protocols static route <CIDR> distance <1-255>
set protocols static route <CIDR> dhcp-interface
set protocols static route <CIDR> blackhole
set protocols static route <CIDR> disable

With any necessary changes also made to the ipv6 command variants.

I'm not familiar enough with the code base to tell if this is actually a limitation of Quagga or not.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close

Event Timeline

Watcher7 created this task.Apr 29 2018, 3:41 PM
varesa added a subscriber: varesa.Apr 29 2018, 3:44 PM
Watcher7 updated the task description. (Show Details)Apr 29 2018, 3:44 PM
Watcher7 updated the task description. (Show Details)Apr 29 2018, 8:29 PM
pasik added a subscriber: pasik.May 15 2018, 9:55 PM
dmbaturin triaged this task as Wishlist priority.May 22 2018, 5:55 AM
dmbaturin added a subscriber: dmbaturin.

Yes, since we let quagga manage static routes (and for a good reason — the kernel does not even try to restore routes if the interface they use flaps), we can only do what quagga allow now, or add something to quagga.

syncer assigned this task to hagbard.Apr 17 2019, 9:09 PM

personally I like the below most. it will require quite an amount of work for migration.

set protocols static route <CIDR> next-hop <ADDR>
set protocols static route <CIDR> interface <DEV>
set protocols static route <CIDR> distance <1-255>
set protocols static route <CIDR> dhcp-interface
set protocols static route <CIDR> blackhole
set protocols static route <CIDR> disable

It fixed in 1.3 version. With "next-hop-interface "

vyos@1.3# set protocols static route 5.5.5.5/32 next-hop 10.230.230.2 next-hop-interface eth2
[edit]
vyos@1.3-netfl# commit

vyos@1.3# run show ip route 5.5.5.5
Routing entry for 5.5.5.5/32
  Known via "static", distance 1, metric 0, best
  Last update 00:00:35 ago
  * 10.230.230.2, via eth2, weight 1

Vtysh

vyos@1.3# vtysh -c "sh run" | match 5.5
ip route 5.5.5.5/32 10.230.230.2 eth2