# Cannot ping the IPv6 gateway



## sdupille (Feb 26, 2013)

Hello,

I've just installed a FreeBSD 9.1 on my computer:

```
# uname -a
FreeBSD cirdan.nospam.fr.eu.org 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     [email]root@farrell.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC  amd64
```

My ISP is providing me two IPv4 and an IPv6, so in my /etc/rc.conf:

```
hostname="cirdan.nospam.fr.eu.org"
ifconfig_em0="inet 5.135.180.147/24"
defaultrouter="5.135.180.254"
ifconfig_em0_ipv6="inet6 2001:41d0:8:bb93::2012/64"
ipv6_static_routes="ovhgw"
ipv6_route_ovhgw="2001:41D0:8:BBff:ff:ff:ff:ff -prefixlen 128 -interface em0"
ipv6_defaultrouter="2001:41D0:8:BBff:ff:ff:ff:ff"
```
Please note that the IPv6 gateway is on a different subnet, that's why I declared a static route.

After reboot, everything seems fine:

```
# ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 4c:72:b9:4f:19:9d
        inet 5.135.180.147 netmask 0xffffff00 broadcast 5.135.180.255
        inet6 fe80::4e72:b9ff:fe4f:199d%em0 prefixlen 64 scopeid 0x1
        inet6 2001:41d0:8:bb93::2012 prefixlen 64
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

# netstat -rn:
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            5.135.180.254      UGS         0      113    em0
5.135.180.0/24     link#1             U           0        0    em0
5.135.180.147      link#1             UHS         0        0    lo0
127.0.0.1          link#5             UH          0        0    lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0
::1                               link#5                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
2001:41d0:8:bb93::/64             link#1                        U           em0
2001:41d0:8:bb93::2012            link#1                        UHS         lo0
2001:41d0:8:bbff:ff:ff:ff:ff      4c:72:b9:4f:19:9d             UHS         em0
fe80::/10                         ::1                           UGRS        lo0
fe80::%em0/64                     link#1                        U           em0
fe80::4e72:b9ff:fe4f:199d%em0     link#1                        UHS         lo0
fe80::%lo0/64                     link#5                        U           lo0
fe80::1%lo0                       link#5                        UHS         lo0
ff01::%em0/32                     fe80::4e72:b9ff:fe4f:199d%em0 U           em0
ff01::%lo0/32                     ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%em0/32                     fe80::4e72:b9ff:fe4f:199d%em0 U           em0
ff02::%lo0/32                     ::1                           U           lo0
```
Well, I have no default route for IPv6. Is that OK?

I can ping myself:

```
# ping6 -c 1 2001:41d0:8:bb93::2012
PING6(56=40+8+8 bytes) 2001:41d0:8:bb93::2012 --> 2001:41d0:8:bb93::2012
16 bytes from 2001:41d0:8:bb93::2012, icmp_seq=0 hlim=64 time=0.046 ms

--- 2001:41d0:8:bb93::2012 ping6 statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.046/0.046/0.046/0.000 ms
```
I can't ping the gateway:

```
# ping6 -c 1 2001:41d0:8:bbff:ff:ff:ff:ff
PING6(56=40+8+8 bytes) 2001:41d0:8:bb93::2012 --> 2001:41d0:8:bbff:ff:ff:ff:ff
ping6: sendmsg: Operation not permitted
ping6: wrote 2001:41d0:8:bbff:ff:ff:ff:ff 16 chars, ret=-1

--- 2001:41d0:8:bbff:ff:ff:ff:ff ping6 statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
```
What's wrong?

Thanks for your help.


----------



## SirDice (Feb 26, 2013)

sdupille said:
			
		

> ```
> ifconfig_em0_ipv6="inet6 2001:41d0:8:bb93::2012/64"
> ipv6_static_routes="ovhgw"
> ipv6_route_ovhgw="2001:41D0:8:BBff:ff:ff:ff:ff -prefixlen 128 -interface em0"
> ...


I don't think these are correct.

This should work:

```
ifconfig_em0_ipv6="inet6 accept_rtadv"
```

http://help.ovh.com/Ipv4Ipv6#link10


----------



## sdupille (Feb 26, 2013)

SirDice said:
			
		

> I don't think these are correct.
> 
> This should work:
> 
> ...



Thanks for your reply.

That doesn't work:

```
# ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 4c:72:b9:4f:19:9d
        inet 5.135.180.147 netmask 0xffffff00 broadcast 5.135.180.255
        inet6 fe80::4e72:b9ff:fe4f:199d%em0 prefixlen 64 scopeid 0x1
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
```

This time I have no IPv6 at all.


----------



## gkontos (Feb 26, 2013)

sdupille said:
			
		

> ```
> # ping6 -c 1 2001:41d0:8:bbff:ff:ff:ff:ff
> PING6(56=40+8+8 bytes) 2001:41d0:8:bb93::2012 --> 2001:41d0:8:bbff:ff:ff:ff:ff
> [B]ping6: sendmsg: Operation not permitted[/B]
> ...



Are you using some host based firewall that prevents ICMP6?


----------



## sdupille (Feb 26, 2013)

gkontos said:
			
		

> Are you using some host based firewall that prevents ICMP6?



Nope. I will configure the firewall only when the IP stack will be up and running.


----------



## SirDice (Feb 26, 2013)

Either reboot or 
`# rtsol em0`


----------



## sdupille (Feb 26, 2013)

SirDice said:
			
		

> Either reboot or
> `# rtsol em0`



I had rebooted. I reboot each time I make a modification in rc.conf.

But even if I can make the router advertisement working, that will not explain why I cannot ping the gateway with my static configuration. If I had a "No route to host" message, I'd conclude that I have a routing issue, but I don't understand the "Operation not permitted". What does this message mean?


----------



## SirDice (Feb 26, 2013)

"Operation not permitted" you get when you either don't have an IPv6 address or there's a firewall blocking. "No route to host" means either it's not the correct IP address for the gateway or there's no (default) route to the network.


----------



## sdupille (Feb 26, 2013)

SirDice said:
			
		

> "Operation not permitted" you get when you either don't have an IPv6 address or there's a firewall blocking. "No route to host" means either it's not the correct IP address for the gateway or there's no (default) route to the network.



That's weird: I have an IP assigned, I have a route, I have no firewall, and I have an "Operation not permitted". There is obviously another reason causing that message.

rc.conf (complete!):

```
zfs_enable="YES"
update_motd="NO"

hostname="cirdan.nospam.fr.eu.org"
ifconfig_em0="inet 5.135.180.147/24"
# ifconfig_em0_alias0="inet 178.32.127.5/32"
defaultrouter="5.135.180.254"
# gateway_enable="YES"

# ipv6_activate_all_interfaces="YES"
ifconfig_em0_ipv6="inet6 2001:41d0:8:bb93::2012/64"
# ifconfig_em0_alias1="inet6 2001:41d0:8:bb93::beef"
# ipv6_gateway_enable="YES"
ipv6_static_routes="ovhgw default"
ipv6_route_ovhgw="2001:41D0:8:BBff:ff:ff:ff:ff -prefixlen 128 -interface em0"
ipv6_defaultrouter="2001:41D0:8:BBff:ff:ff:ff:ff"
# ipv6_default_interface="em0"

pf_enable="NO"
pflog_enable="NO"

sshd_enable="YES"

syslogd_enabled="YES"
syslogd_flags="-ss -8 -C -c -vv"

ntpdate_enable="YES"
ntpdate_hosts="213.186.33.99"
ntpd_enable="YES"
```

*ifconfig*:

```
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 4c:72:b9:4f:19:9d
        inet 5.135.180.147 netmask 0xffffff00 broadcast 5.135.180.255
        inet6 fe80::4e72:b9ff:fe4f:199d%em0 prefixlen 64 scopeid 0x1
        inet6 2001:41d0:8:bb93::2012 prefixlen 64
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```

*netstat -rn*:

```
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            5.135.180.254      UGS         0      448    em0
5.135.180.0/24     link#1             U           0        2    em0
5.135.180.147      link#1             UHS         0        0    lo0
127.0.0.1          link#5             UH          0        0    lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0 =>
default                           2001:41d0:8:bbff:ff:ff:ff:ff  UGS         em0
::1                               link#5                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
2001:41d0:8:bb93::/64             link#1                        U           em0
2001:41d0:8:bb93::2012            link#1                        UHS         lo0
2001:41d0:8:bbff:ff:ff:ff:ff      4c:72:b9:4f:19:9d             UHS         em0
fe80::/10                         ::1                           UGRS        lo0
fe80::%em0/64                     link#1                        U           em0
fe80::4e72:b9ff:fe4f:199d%em0     link#1                        UHS         lo0
fe80::%lo0/64                     link#5                        U           lo0
fe80::1%lo0                       link#5                        UHS         lo0
ff01::%em0/32                     fe80::4e72:b9ff:fe4f:199d%em0 U           em0
ff01::%lo0/32                     ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%em0/32                     fe80::4e72:b9ff:fe4f:199d%em0 U           em0
ff02::%lo0/32                     ::1                           U           lo0
```

And it was freshly booted:

```
$ uptime
 1:57PM  up 2 mins, 1 user, load averages: 0.00, 0.15, 0.11
$ ping6 -c1 2001:41d0:8:bbff:ff:ff:ff:ff
PING6(56=40+8+8 bytes) 2001:41d0:8:bb93::2012 --> 2001:41d0:8:bbff:ff:ff:ff:ff
ping6: sendmsg: Operation not permitted
ping6: wrote 2001:41d0:8:bbff:ff:ff:ff:ff 16 chars, ret=-1

--- 2001:41d0:8:bbff:ff:ff:ff:ff ping6 statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
$ ping6 -c1 www.google.fr
PING6(56=40+8+8 bytes) 2001:41d0:8:bb93::2012 --> 2a00:1450:4016:801::101f
ping6: sendmsg: Operation not permitted
ping6: wrote www.google.fr 16 chars, ret=-1

--- www.google.fr ping6 statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
```


----------



## SirDice (Feb 26, 2013)

I'm just going to post the same link again, http://help.ovh.com/Ipv4Ipv6#link10


----------



## sdupille (Feb 26, 2013)

SirDice said:
			
		

> I'm just going to post the same link again, http://help.ovh.com/Ipv4Ipv6#link10



Ok, let's try again. In my /etc/sysctl.conf:

```
net.inet6.ip6.accept_rtadv=1
```

In my rc.conf:

```
ifconfig_em0_ipv6="inet6 accept_rtadv"
```

At boot time, no IPv6 assigned:

```
# ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 4c:72:b9:4f:19:9d
        inet 5.135.180.147 netmask 0xffffff00 broadcast 5.135.180.255
        inet6 fe80::4e72:b9ff:fe4f:199d%em0 prefixlen 64 scopeid 0x1
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```

Correct me if *I*'m wrong, but router advertisement is not about giving an IP?

If I go on with that doc, and adding an IP manually:

```
# ifconfig em0 inet6 2001:41d0:8:bb93::2012/64
# ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 4c:72:b9:4f:19:9d
        inet 5.135.180.147 netmask 0xffffff00 broadcast 5.135.180.255
        inet6 fe80::4e72:b9ff:fe4f:199d%em0 prefixlen 64 scopeid 0x1
        inet6 2001:41d0:8:bb93::2012 prefixlen 64
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            5.135.180.254      UGS         0      239    em0
5.135.180.0/24     link#1             U           0        3    em0
5.135.180.147      link#1             UHS         0        0    lo0
127.0.0.1          link#5             UH          0        0    lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0 =>
default                           fe80::264:40ff:fe3a:fac0%em0  UG          em0
::1                               link#5                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
2001:41d0:8:bb00::/56             link#1                        U           em0
2001:41d0:8:bb93::/64             link#1                        U           em0
2001:41d0:8:bb93::2012            link#1                        UHS         lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%em0/64                     link#1                        U           em0
fe80::4e72:b9ff:fe4f:199d%em0     link#1                        UHS         lo0
fe80::%lo0/64                     link#5                        U           lo0
fe80::1%lo0                       link#5                        UHS         lo0
ff01::%em0/32                     fe80::4e72:b9ff:fe4f:199d%em0 U           em0
ff01::%lo0/32                     ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%em0/32                     fe80::4e72:b9ff:fe4f:199d%em0 U           em0
ff02::%lo0/32                     ::1                           U           lo0
# ping6 -c1 www.google.fr
PING6(56=40+8+8 bytes) 2001:41d0:8:bb93::2012 --> 2a00:1450:4016:801::1018
16 bytes from 2a00:1450:4016:801::1018, icmp_seq=0 hlim=54 time=19.517 ms

--- www.google.fr ping6 statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 19.517/19.517/19.517/0.000 ms
```

Yup, it works! But how can I assign to em0 both the router advertisement, and an IPv6?

I added this to /etc/rc.conf:

```
ipv6_cpe_wanif="em0"
ifconfig_em0_ipv6="inet6 2001:41d0:8:bb93::2012/64"
```

Now, when I boot:

```
# ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 4c:72:b9:4f:19:9d
        inet 5.135.180.147 netmask 0xffffff00 broadcast 5.135.180.255
        inet6 fe80::4e72:b9ff:fe4f:199d%em0 prefixlen 64 scopeid 0x1
        inet6 2001:41d0:8:bb93::2012 prefixlen 64
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
# ping6 www.google.fr
ping6: UDP connect: No route to host
# rtsol -d em0
cirdan#  ping6 www.google.fr
PING6(56=40+8+8 bytes) 2001:41d0:8:bb93::2012 --> 2a00:1450:4016:801::1018
16 bytes from 2a00:1450:4016:801::1018, icmp_seq=0 hlim=54 time=19.499 ms
16 bytes from 2a00:1450:4016:801::1018, icmp_seq=1 hlim=54 time=19.527 ms
^C
--- www.google.fr ping6 statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 19.499/19.513/19.527/0.014 ms
```

OK, so now, everything is up and running, but the route need some tweaks. Should I add a static route?


----------



## SirDice (Feb 26, 2013)

The RA is basically just temporary to figure out what default gateway to use on IPv6. Once you set static addresses (and the correct gateway) you can turn it off.


----------



## sdupille (Feb 26, 2013)

SirDice said:
			
		

> The RA is basically just temporary to figure out what default gateway to use on IPv6. Once you set static addresses (and the correct gateway) you can turn it off.



Well, if I set a static address, with a static route, it doesn't work. After some several tries, I finally found what's working, and it's pretty simple: assign a static IP, and leave the routing strategy to RTADV, like this:

```
ifconfig_em0_ipv6="inet6 accept_rtadv 2001:41d0:8:bb93::2012/64"
```

That's all. I didn't know that I could set both an IPv6 and accept_rtadv, and that was the point I was missing.

Many thanks for your help!


----------



## sdupille (Feb 26, 2013)

sdupille said:
			
		

> Well, if I set a static address, with a static route, it doesn't work. After some several tries, I finally found what's working, and it's pretty simple: assign a static IP, and leave the routing strategy to RTADV, like this:
> 
> ```
> ifconfig_em0_ipv6="inet6 accept_rtadv 2001:41d0:8:bb93::2012/64"
> ...



Well... Not solved! No, in the end, it doesn't work. The route disappears after some time.

Two choices: I may have an automatic route usable for five minutes, either I can have a static route and an interface unusable with "Operation not permitted".

What's next?


----------



## schrodinger (Mar 12, 2013)

@sdupille, I had the exact same problem as you.

Ideally I want to use SLAAC for first hop redundancy but I don't want my interface to auto configure addresses.

Right now it is unclear to me what ipv6_enable still does when set in /etc/rc.conf but OVH set this as part of the FreeBSD install template but this is deprecated in FreeBSD 9.1 - however still undocumented.

In FreeBSD <=8.x this used to invoke rtsol on boot.

Handbook - IPv6

Problem Report 170223

OVH assign a /64 to their customers dedicated servers but the default gateway you are assigned is at the end of a /56 (in your case 2001:41D0:8:BB00::/56) which one must presume they dish out to ~256 customers. If you set a defaultrouter for v6 and change your prefixlen to 56 it will Just Work. However, that's not exactly the solution.

I believe the primary issue is that the static route is applied AFTER the RC tries to set the default gateway, this results in an error during boot :


```
route: writing to routing socket: Network is unreachable
add net default: gateway 2001:41d0:2:e7ff:ff:ff:ff:ff: Network is unreachable
add host 2001:41d0:2:e7ff:ff:ff:ff:ff: gateway re0
```

Chicken, egg, ipv6.

Try /etc/rc.conf :


```
ipv6_activate_all_interfaces="YES"
ipv6_network_interfaces="auto"
ip6addrctl_policy="ipv6_prefer"
ifconfig_em0_ipv6="inet6 accept_rtadv 2001:41d0:8:bb93::2012/64"
ipv6_static_routes="ovhgw default"
ipv6_route_ovhgw="2001:41D0:8:BBff:ff:ff:ff:ff -prefixlen 128 -interface em0"
ipv6_route_default="default 2001:41D0:8:BBff:ff:ff:ff:ff"
rtsold_enable="YES"
rtsold_flags="em0"
```

Comment out their entries in /etc/sysctl.conf 


```
#net.inet6.ip6.accept_rtadv=0
#net.inet6.ip6.auto_linklocal=0
```

This is what I use and everything is working fine so far. I only have the inet4 and inet6 static addresses on my re0, rtsold is then running for FHRP resilience.


----------



## sdupille (Mar 12, 2013)

schrodinger said:
			
		

> This is what I use and everything is working fine so far. I only have the inet4 and inet6 static addresses on my re0, rtsold is then running for FHRP resilience.



Thanks a lot for your reply. After a brief comment with OVH, it appears that RTADV feature is down. Surprisingly, router still adverts itself but it is supposed to be off, that's why we cannot get an IPv6 with RTADV.

The solution we found was the following:

```
ipv6_ifconfig_em0="fe80::4e72:b9ff:fe4f:199d"
ifconfig_em0_alias1="inet6 2001:41d0:8:bb93::2012/64"
ifconfig_em0_alias2="inet6 2001:41d0:8:bb93::beef"
ipv6_defaultrouter="fe80::da24:bdff:fe90:b0c0%em0"
ipv6_gateway_enable="YES"
```

We asssign manually a fe80:: address to the interface, and give _real_ IPv6 as aliases. And I talk to the router with the address it advertised (which is weirdly a link-local address).

It works perfectly since last week.


----------



## kpa (Mar 12, 2013)

Gateway address can be a link-local address in IPv6, nothing strange about it.


----------



## schrodinger (Mar 12, 2013)

sdupille said:
			
		

> Thanks a lot for your reply. After a brief comment with OVH, it appears that RTADV feature is down. Surprisingly, router still adverts itself but it is supposed to be off, that's why we cannot get an IPv6 with RTADV.
> 
> The solution we found was the following:
> 
> ...



Ah I see, I will kill rtsold in that case. Thanks very much for the reply.

This is my new /etc/rc.conf :


```
ipv6_activate_all_interfaces="YES"
ipv6_network_interfaces="auto"
ip6addrctl_policy="ipv6_prefer"

ifconfig_re0_ipv6="inet6 2001:41D0:2:E7c4::1 prefixlen 64"

ipv6_static_routes="ovhgw default"
ipv6_route_ovhgw="2001:41d0:2:e7ff:ff:ff:ff:ff -prefixlen 128 -interface re0"
ipv6_route_default="default 2001:41d0:2:e7ff:ff:ff:ff:ff"
```

/etc/sysctl.conf


```
net.inet6.ip6.accept_rtadv=0
#net.inet6.ip6.auto_linklocal=0
```

And that breaks connectivity. 


```
root@ks383965 [17]-(~) # ifconfig 
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
        ether e0:69:95:88:0b:27
        inet 46.105.120.196 netmask 0xffffff00 broadcast 46.105.120.255
        inet6 fe80::e269:95ff:fe88:b27%re0 prefixlen 64 scopeid 0x1 
        inet6 2001:41d0:2:e7c4::1 prefixlen 64 
        nd6 options=23<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
root@ks383965 [17]-(~) # netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            46.105.120.254     UGS         0      906    re0
46.105.120.0/24    link#1             U           0     1008    re0
46.105.120.196     link#1             UHS         0        0    lo0
127.0.0.1          link#7             UH          0        0    lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0 =>
default                           2001:41d0:2:e7ff:ff:ff:ff:ff  UGS         re0
::1                               link#7                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
2001:41d0:2:e7c4::/64             link#1                        U           re0
2001:41d0:2:e7c4::1               link#1                        UHS         lo0
2001:41d0:2:e7ff:ff:ff:ff:ff      e0:69:95:88:0b:27             UHS         re0
fe80::/10                         ::1                           UGRS        lo0
fe80::%re0/64                     link#1                        U           re0
fe80::e269:95ff:fe88:b27%re0      link#1                        UHS         lo0
fe80::%lo0/64                     link#7                        U           lo0
fe80::1%lo0                       link#7                        UHS         lo0
ff01::%re0/32                     fe80::e269:95ff:fe88:b27%re0  U           re0
ff01::%lo0/32                     ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%re0/32                     fe80::e269:95ff:fe88:b27%re0  U           re0
ff02::%lo0/32                     ::1                           U           lo0
root@ks383965 [17]-(~) # ping6 www.google.ie
PING6(56=40+8+8 bytes) 2001:41d0:2:e7c4::1 --> 2a00:1450:4002:804::101f
ping6: sendmsg: Operation not permitted
ping6: wrote www.google.ie 16 chars, ret=-1
ping6: sendmsg: Operation not permitted
ping6: wrote www.google.ie 16 chars, ret=-1
^C
--- www.google.ie ping6 statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss

root@ks383965 [17]-(~) #
```


Based on what you have said RTADV isn't performed by OVH and you figured out the link local address of the default gateway by coincidence that it's still advertising itself. This means that if OVH properly disable router advertisements IPv6 will most likely break. The only way it will work is if the interface can receive a router advertisements and obviously that the router is advertising itself.... No ?

You should not have to assign a link-local address to your interface. There should already be one. OVH set 


```
net.inet6.ip6.auto_linklocal=0
```

This is incorrect unless you are configuring it yourself, as I understand from documentation.

http://lists.freebsd.org/pipermail/freebsd-questions/2012-January/237325.html

See "BUGS" at the end of the FreeBSD 9.1 IFCONFIG(8).



			
				kpa said:
			
		

> Gateway address can be a link-local address in IPv6, nothing strange about it.



Indeed. http://lists.freebsd.org/pipermail/freebsd-questions/2012-January/237316.html

I'm not entirely sure where the problem is now, FreeBSD or OVH ?


----------



## schrodinger (Mar 12, 2013)

I have changed my configuration around somewhat and it is working again but this isn't a solution either.

In /etc/rc.conf I changed to include _accept_rtadv_


```
ifconfig_re0_ipv6="inet6 accept_rtadv 2001:41D0:2:E7c4::1 prefixlen 64"
```

This now works, I can communicate with the IPv6 Internet, but it would mean that I am accepting a router advertisement which changes the default gateway to the link local address of the router and not 2001:41d0:2:e7ff:ff:ff:ff:ff


```
default                           fe80::21e:13ff:fef9:9b00%re0  UG          re0
```


```
root@ks383965 [17]-(~) # ifconfig 
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
        ether e0:69:95:88:0b:27
        inet 46.105.120.196 netmask 0xffffff00 broadcast 46.105.120.255
        inet6 fe80::e269:95ff:fe88:b27%re0 prefixlen 64 scopeid 0x1 
        inet6 2001:41d0:2:e7c4::1 prefixlen 64 
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
root@ks383965 [17]-(~) # netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            46.105.120.254     UGS         0       72    re0
46.105.120.0/24    link#1             U           0        1    re0
46.105.120.196     link#1             UHS         0        0    lo0
127.0.0.1          link#7             UH          0        0    lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0 =>
default                           fe80::21e:13ff:fef9:9b00%re0  UG          re0
::1                               link#7                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
2001:41d0:2:e700::/56             link#1                        U           re0
2001:41d0:2:e7c4::/64             link#1                        U           re0
2001:41d0:2:e7c4::1               link#1                        UHS         lo0
2001:41d0:2:e7ff:ff:ff:ff:ff      e0:69:95:88:0b:27             UHS         re0
fe80::/10                         ::1                           UGRS        lo0
fe80::%re0/64                     link#1                        U           re0
fe80::e269:95ff:fe88:b27%re0      link#1                        UHS         lo0
fe80::%lo0/64                     link#7                        U           lo0
fe80::1%lo0                       link#7                        UHS         lo0
ff01::%re0/32                     fe80::e269:95ff:fe88:b27%re0  U           re0
ff01::%lo0/32                     ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%re0/32                     fe80::e269:95ff:fe88:b27%re0  U           re0
ff02::%lo0/32                     ::1                           U           lo0
root@ks383965 [17]-(~) #
```


----------

