netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* iproute2 - modifying routes in place
@ 2018-05-11 11:42 Ryan Whelan
  2018-05-12 17:00 ` David Ahern
  0 siblings, 1 reply; 6+ messages in thread
From: Ryan Whelan @ 2018-05-11 11:42 UTC (permalink / raw)
  To: netdev

`ip route` has 2 subcommands that don't seem to work as expected and i'm
not sure if its a bug, or if i'm misunderstanding the semantics.

I am unable to modify a route 'in place', which from what i'm reading
online, I should be able to do with `ip route change` and/or `ip route
replace`.

After a route is created with either `ip route add` or `ip route replace`,
I am unable to use `change`, regardless of how I attempt to identify the
route i'm trying to alter.

  # ip -6 route show
...
fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0 src
fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 1000 pref medium
fe80::/64 dev enp0s3 proto kernel metric 256 pref medium
fe80::/64 dev enp0s8 proto kernel metric 256 pref medium
fe80::/64 dev internal0 proto kernel metric 256 pref medium


If i try to change the metric of the route that already exist via `ip route
change`, i get "No such file or directory.

# ip -6 route change fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0
src fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 100
RTNETLINK answers: No such file or directory


If i use `replace`, the command does not error, but creates another route
instead of replacing the current route.

# ip -6 route replace fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0
src fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 100

# ip -6 route show
...
fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0 src
fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 100 pref medium
fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0 src
fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 1000 pref medium
fe80::/64 dev enp0s3 proto kernel metric 256 pref medium
fe80::/64 dev enp0s8 proto kernel metric 256 pref medium
fe80::/64 dev internal0 proto kernel metric 256 pref medium

What am I missing or doing wrong?  Forgive me if i'm being dense, but i
could not find an answer online to explain this behavior.

If this is the wrong forum for this question, I apologize; please point me
in the right direction?

Linux: 4.16.6
iproute2: 4.15.0

Thank you!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-14 20:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-11 11:42 iproute2 - modifying routes in place Ryan Whelan
2018-05-12 17:00 ` David Ahern
2018-05-14 18:40   ` Ryan Whelan
2018-05-14 18:49     ` David Ahern
2018-05-14 20:10       ` Ryan Whelan
2018-05-14 20:20         ` David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).