Cannot add an ipv6 route with -interface

Kevin Oberman rkoberman at gmail.com
Thu Oct 22 23:34:17 UTC 2015


On Thu, Oct 22, 2015 at 4:08 PM, Alarig Le lay <alarig at swordarmor.fr> wrote:

> Hi,
>
> I try to add an IPv6 route on a 10.1 FreeBSD router by using the option
> -interface. It works with IPv4 but not with IPv6.
>
> In IPv4:
> alarig at nominoe:~ % ping 192.168.1.1
> PING 192.168.1.1 (192.168.1.1): 56 data bytes
> 76 bytes from te0-0-2-2.rcr11.uro01.atlas.cogentco.com (130.117.1.242):
> Destination Net Unreachable
> Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
>  4  5  68 0054 0bea   0 0000  3e  01 d145 149.6.72.98  192.168.1.1
> alarig at nominoe:~ % sudo route add 192.168.1.0/24 -interface em1
> add net 192.168.1.0: gateway em1
> alarig at nominoe:~ % ping 192.168.1.1
> PING 192.168.1.1 (192.168.1.1): 56 data bytes
> 64 bytes from 192.168.1.1: icmp_seq=75 ttl=64 time=0.831 ms
>
> In IPv6:
> alarig at nominoe:~ % ping6 2a00:5884:8200::100
> PING6(56=40+8+8 bytes) 2001:978:2:4e::5:2 --> 2a00:5884:8200::100
> ^C
> --- 2a00:5884:8200::100 ping6 statistics ---
> 3 packets transmitted, 0 packets received, 100.0% packet loss
>
> alarig at nominoe:~ % sudo route add -6 2a00:5884:8200::/40 -interface em1
> add net 2a00:5884:8200::/40: gateway em1
> alarig at nominoe:~ % ping6 2a00:5884:8200::100
> PING6(56=40+8+8 bytes) 2a00:5884::1 --> 2a00:5884:8200::100
> ping6: sendmsg: Operation not permitted
> ping6: wrote 2a00:5884:8200::100 16 chars, ret=-1
>
> This operation works on linux:
> alarig at judicael:~$ ping6 2a00:5884:8200::100
> PING 2a00:5884:8200::100(2a00:5884:8200::100) 56 data bytes
> From 2a00:5884::1 icmp_seq=1 Destination unreachable: Address
> unreachable
> From 2a00:5884::1 icmp_seq=2 Destination unreachable: Address
> unreachable
> ^C
> --- 2a00:5884:8200::100 ping statistics ---
> 2 packets transmitted, 0 received, +2 errors, 100% packet loss, time
> 1007ms
> alarig at judicael:~$ sudo ip -6 route add 2a00:5884:8200::/40 dev eth0
> alarig at judicael:~$ ping6 2a00:5884:8200::100
> PING 2a00:5884:8200::100(2a00:5884:8200::100) 56 data bytes
> 64 bytes from 2a00:5884:8200::100: icmp_seq=1 ttl=63 time=1.41 ms
> 64 bytes from 2a00:5884:8200::100: icmp_seq=2 ttl=63 time=0.588 ms
> 64 bytes from 2a00:5884:8200::100: icmp_seq=3 ttl=63 time=0.459 ms
> ^C
> --- 2a00:5884:8200::100 ping statistics ---
> 3 packets transmitted, 3 received, 0% packet loss, time 2000ms
> rtt min/avg/max/mdev = 0.459/0.819/1.410/0.421 ms
>
> It also works if I add an intermediate router:
> alarig at nominoe:~ % sudo route add -6 2a00:5884:8200::/40 2a00:5884::3
> add net 2a00:5884:8200::/40: gateway 2a00:5884::3
> alarig at nominoe:~ % ping6 2a00:5884:8200::100
> PING6(56=40+8+8 bytes) 2a00:5884::1 --> 2a00:5884:8200::100
> 16 bytes from 2a00:5884:8200::100, icmp_seq=0 hlim=64 time=0.590 ms
> 16 bytes from 2a00:5884:8200::100, icmp_seq=1 hlim=64 time=0.699 ms
> 16 bytes from 2a00:5884:8200::100, icmp_seq=2 hlim=64 time=0.764 ms
> 16 bytes from 2a00:5884:8200::100, icmp_seq=3 hlim=64 time=0.806 ms
> ^C
> --- 2a00:5884:8200::100 ping6 statistics ---
> 4 packets transmitted, 4 packets received, 0.0% packet loss
> round-trip min/avg/max/std-dev = 0.590/0.715/0.806/0.081 ms
>
>
> This router is theoretically useless as it is on the same network than the
> FreeBSD one.
>
> Do you have any idea about this issue? Did I make a mistake or is it a
> bug?
>
> Thanks,
> --
> Alarig Le Lay
>

Take a look at route(8). There are significant syntax differences. E.g. On
FreeBSD route(8) has no "-6" option. It uses "-inet6". That may not be the
only issue, but I need to get out the door to get to a hockey match. the
rest is at least close.
--
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman at gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683


More information about the freebsd-net mailing list