Cannot add an ipv6 route with -interface

Alarig Le lay alarig at swordarmor.fr
Thu Oct 22 23:08:40 UTC 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20151023/75117a09/attachment.bin>


More information about the freebsd-net mailing list