From: "Toke Høiland-Jørgensen" <toke@kernel.org>
To: Robert Landers <landers.robert@gmail.com>, netdev@vger.kernel.org
Subject: Re: Maybe a bug with adding default routes?
Date: Wed, 19 Apr 2023 11:51:25 +0200 [thread overview]
Message-ID: <878reourmq.fsf@toke.dk> (raw)
In-Reply-To: <CAPzBOBNKPYFwm5Fq9hvEPPVk7RHjzPOO5gpnVXeT-2dgk_f69Q@mail.gmail.com>
Robert Landers <landers.robert@gmail.com> writes:
> Hello netdev,
>
> I believe I either found a bug, or I'm doing something wrong (probably
> the latter, or both!). I was experimenting with getting a "floating
> IP" for my home lab, and eventually, I got it to work, but it requires
> some voodoo, which intrigued me and I think I found some strange
> behavior that smells like a bug. I'm on Ubuntu 22.04 (and Pop OS! on
> my desktop), so it is also possible that this is fixed upstream (in
> which case, I'll email that list next).
>
> To reproduce is quite simple:
>
> echo "1234 test" >> /etc/iproute2/rt_tables
> ip route add default via 167.235.212.73 dev enp9s0 table test
>
> This will fail with the error:
>
> Error: Nexthop has invalid gateway.
>
> Now, I think this makes sense, however, the routing table shouldn't
> need to know about hops, Right? Maybe I'm wrong, but this voodoo
> results in a correct routing table:
>
> ip addr add 167.235.212.72/29 dev enp9s0
> ip route add default via 167.235.212.73 dev enp9s0 table test
> ip addr del 167.235.212.72/29 dev enp9s0
>
> I'm not sure if this is a bug or working as designed. It smells like a
> bug, but I could just as easily be doing something wrong. I grew up in
> "simpler" times and am not nearly as familiar with iproute2 as I was
> with the old stuff.
Try the 'onlink' flag:
ip route add default via 167.235.212.73 dev enp9s0 onlink table test
-Toke
next prev parent reply other threads:[~2023-04-19 9:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 6:47 Maybe a bug with adding default routes? Robert Landers
2023-04-19 9:51 ` Toke Høiland-Jørgensen [this message]
2023-04-19 10:20 ` Robert Landers
2023-04-19 10:33 ` Toke Høiland-Jørgensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878reourmq.fsf@toke.dk \
--to=toke@kernel.org \
--cc=landers.robert@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.