On 2016 Apr 08 (Fri) at 08:53:45 +0000 (+0000), Stuart Henderson wrote: :On 2016-04-07, Doran Mori <dhm...@gmail.com> wrote: :> Running 5.9. :> :> I have x.x.141.0/25 that's directly connected. With x.x.141.0/24 reachable :> via bgp. :> :> # route -n get x.x.141.13 :> route to: x.x.141.13 :> destination: x.x.141.0 :> mask: 255.255.255.128 :> interface: em3 :> if address: x.x.141.112 :> priority: 4 (connected) :> flags: <UP,DONE,CLONING> :> :> # ifconfig em3 down :> jawaka# route -n get x.x.141.13 :> route to: x.x.141.13 :> destination: 66.117.141.0 :> mask: 255.255.255.128 :> interface: em3 :> if address: x.x.141.112 :> priority: 4 (connected) :> flags: <DONE,CLONING> :> :> I see the UP flag is removed but it has no effect. :> :> # ping x.x.141.13 :> PING x.x.141.13 (x.x.141.13): 56 data bytes :> ping: sendto: Network is down :> :> I would expect this route to be used instead: :> # route -n get x.x.141.0/24 :> route to: x.x.141.0 :> destination: x.x.141.0 :> mask: 255.255.255.0 :> gateway: x.x.144.154 :> interface: em2 :> if address: x.x.144.153 :> priority: 48 (bgp) :> flags: <UP,GATEWAY,DONE> :> :> I searched the archives but didn't see this specific case mentioned. Can :> someone enlighten me? : :That is how things normally work. : :Sometimes the behaviour you want would be useful (especially for :machines that move between wired and wireless connectivity) but in other :cases (e.g. the usual case with a bgp router) it would be undesirable as :it would cause a routing loop, so there's no one-size-fits-all answer. : :I'm not sure if there is any way to manipulate the route entry to do :what you want. If there is, it's non-obvious at least! :
You can add a "backup" route of an equal prefix length. In such a case, the backup route will take over. -- Pushing 40 is exercise enough.