Static IPv6 route with a link-local next-hop
Ondrej Zajicek
santiago at crfreenet.org
Fri Jul 17 22:31:11 CEST 2015
On Wed, Jul 08, 2015 at 07:29:26PM +0200, Baptiste Jonglez wrote:
> Hi,
>
> Since this was non-obvious to get working, I'm sharing this here.
>
> To add a static route via a link-local next-hop, this configuration works:
>
> protocol direct {
> interface "eth0";
> }
>
> protocol static {
> route 2001:db8::/32 via fe80::1%eth0;
> }
>
>
> If the "protocol direct" is omitted, then Bird never uses the route,
> and doesn't give any reason why in the logs (even with debug activated).
Hi
Not sure what problem you hit here, but it works for me without
the protocol direct:
bird> show route
2001:db8::/32 via fe80::1 on eth1 [static1 22:15:25] * (200)
> Another difficulty is that all of the following are syntactically correct:
>
> route 2001:db8:1::/48 via "eth0";
> route 2001:db8:2::/48 via fe80::1%eth0;
> route 2001:db8:3::/48 via "fe80::1%eth0";
> route 2001:db8:4::/48 via fe80::1;
>
> However, only the first two forms are legal:
>
> - « via "eth0" » adds a directly connected route (which is probably not
> what you want depending on your use-case, but fully legal)
>
> - « via fe80::1%eth0 » gives the expected result, a static route via
> fe80::1 on interface eth0.
>
> - « via "fe80::1%eth0" » fails silently. I guess the parser takes all
> this as an interface name, which (obviously) does not exist.
Yes
> - « via fe80::1 » fails at runtime with « Static route destination fe80::1
> is invalid. Ignoring. » in the logs, which is a very sensible behaviour.
Perhaps it should fail at configure-time
> I think this is intricate enough to be noted somewhere in a documentation
> or wiki. Is this wiki [https://gitlab.labs.nic.cz/labs/bird/wikis/home]
> open to contributions?
It is true that it should be documented in the static route documentation.
Generally, link-local address handling in BIRD is in most cases
afterthought and often it is not very elegant. For static protocol, i
would perhaps prefer the syntax similar to 'ip' tool:
route 2001:db8:1::/48 via 2001:db8:2::1;
route 2001:db8:2::/48 dev eth0;
route 2001:db8:3::/48 via fe80::1 dev eth0;
--
Elen sila lumenn' omentielvo
Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20150717/d2487e2e/attachment.asc>
More information about the Bird-users
mailing list