Static IPv6 route with a link-local next-hop

Baptiste Jonglez baptiste at bitsofnetworks.org
Wed Jul 8 19:29:26 CEST 2015


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).

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.

- « via fe80::1 » fails at runtime with « Static route destination fe80::1
  is invalid. Ignoring. » in the logs, which is a very sensible behaviour.


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?

Maybe it would also help if Bird was a bit more verbose on the edge cases
above? (e.g. a static route through an interface without a "protocol direct"
should probably be logged somewhere)

Thanks,
Baptiste
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20150708/27ff6447/attachment.asc>


More information about the Bird-users mailing list