# IPV6 working only a few seconds after boot



## C5455 (Jan 21, 2017)

I'm currently running 11.0-RELEASE-p7 in one of those cheap 1€ aruba VPS machines servers for fun.

Their current control panel doesn't support ipv6 auto configuration therefore it must be configured manually.

I'm able to configure the ipv6, but I lost connectivity a few seconds after boot.

My current rc.conf is the following:

```
ifconfig_vmx0="inet z.y.z.w netmask 255.255.255.0"
defaultrouter="x.y.z.w"
vnstat_enable="YES"

#ipv6
#ip6addrctl_enable="YES"
#ip6addrctl_policy="ipv6_prefer"
ifconfig_vmx0_ipv6="inet6 accept_rtadv"
rtsold_enable="YES"
ifconfig_vmx0_ipv6="inet6 2a00:6d41:0010:116a::190 prefixlen 64"
ipv6_defaultrouter="fe80::1%vmx0"
```

Example of pinging a few seconds after boot:

```
$ ping6 www.kame.net
PING6(56=40+8+8 bytes) 2a00:6d41:10:116a::190 --> 2001:200:dff:fff1:216:3eff:feb1:44d7
16 bytes from 2001:200:dff:fff1:216:3eff:feb1:44d7, icmp_seq=0 hlim=48 time=264.280 ms
16 bytes from 2001:200:dff:fff1:216:3eff:feb1:44d7, icmp_seq=1 hlim=48 time=264.719 ms
16 bytes from 2001:200:dff:fff1:216:3eff:feb1:44d7, icmp_seq=2 hlim=48 time=264.367 ms
```

And after this goes silent (number of pings depends how fast i am to start pinging after boot).

I tried:
1) to change: *ifconfig_vmx0_ipv6="inet6"* and *rtsold_enable="NO"*, with no success
2) to change timezone to VPS location timezone

Any ideas?


----------



## C5455 (Jan 21, 2017)

```
#ifconfig
       vmx0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 
       options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,RXCSUM_IPV6,TXCSUM_IPV6> 
       ether 00:50:56:b0:f3:79 
       inet x.y.z.w netmask 0xffffff00 broadcast x.y.z.w
       inet6 fe80::250:56ff:feb0:f379%vmx0 prefixlen 64 scopeid 0x1  
       inet6 2a00:6d41:10:116a::190 prefixlen 64  
       nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL> 
       media: Ethernet autoselect 
       status: active
```


```
# netstat -r -6 
Routing tables 

Internet6: 
Destination        Gateway            Flags     Netif Expire 
::/96              localhost          UGRS        lo0 
default            fe80::1%vmx0       UGS        vmx0 
localhost          link#4             UH          lo0 
::ffff:0.0.0.0/96  localhost          UGRS        lo0 
2a00:6d41:10:116a: link#1             U          vmx0 
2a00:6d41:10:116a: link#1             UHS         lo0 
fe80::/10          localhost          UGRS        lo0 
fe80::%vmx0/64     link#1             U          vmx0 
fe80::250:56ff:feb link#1             UHS         lo0 
fe80::%lo0/64      link#4             U           lo0 
fe80::1%lo0        link#4             UHS         lo0 
ff02::/16          localhost          UGRS        lo0
```


----------



## ShelLuser (Jan 22, 2017)

Bear with me: it's been quite a while since I worked with this, so I could mix up some specific points. But: I assume you're using a firewall? Does your firewall allow for IPv6 propagation?

Here's the thing (and where I might go wrong on specifics): on IPv4 you have not much control over how other computers might obtain your MAC address. Talking about ARP. But this is fully controllable (and blockable by a firewall) on IPv6.

Last time I had to deal with this (a few years back) it turned out that I had to specifically allow the upstream IPv6 router to propagate in my IPv6 firewall. I ended up adjusting my firewall after which the router could continue to propagate.

My suggestion is to use tcpdump to check your network data. I'm sure you'll see hints that your upstream router is requesting for specific data but not getting it from your server.


----------



## C5455 (Jan 22, 2017)

Firewall is completely disabled just to avoid adding more variables to the problem, so that can be excluded.

EDIT: anything suspicious? tcpdump 
http://pastebin.com/rMWg3Jqq


----------



## SirDice (Jan 23, 2017)

> ```
> ifconfig_vmx0_ipv6="inet6 accept_rtadv"
> ifconfig_vmx0_ipv6="inet6 2a00:6d41:0010:116a::190 prefixlen 64"
> ```


These two are mutually exclusive. You either allow SLAAC or you set a static IP address, you can't do both.

https://en.wikipedia.org/wiki/IPv6#Stateless_address_autoconfiguration_.28SLAAC.29


----------



## C5455 (Jan 23, 2017)

SirDice said:


> These two are mutually exclusive. You either allow SLAAC or you set a static IP address, you can't do both.
> 
> https://en.wikipedia.org/wiki/IPv6#Stateless_address_autoconfiguration_.28SLAAC.29



Thank you. fixed.
Now I have in rc.conf:


```
ifconfig_vmx0_ipv6="inet6 2a00:6d41:0010:116a::1 prefixlen 64"  
ipv6_defaultrouter="fe80::1%vmx0"
```

and tested adding 

```
ipv6_cpe_wanif="vmx0"
```

without success. I still lost connectivity after ~20seconds after boot


----------



## SirDice (Jan 23, 2017)

Is this IPv6 address actually assigned to you? Or did you pick a random address?


----------



## C5455 (Jan 23, 2017)

SirDice said:


> Is this IPv6 address actually assigned to you? Or did you pick a random address?


I picked a random ip address from the /64 assigned to me.


```
Start range:    2a00:6d41:0010:116a:0000:0000:0000:0001
End range:    2a00:6d41:0010:116a:ffff:ffff:ffff:ffff
Gateway:    fe80::1
```

Even if I was picking an wrong address, would that justify the 20 seconds of working connectivity?


----------



## SirDice (Jan 23, 2017)

No, as long as it's an address in the assigned prefix. For a moment I was afraid you might have picked a random address causing IP conflicts at the hoster.


----------



## pulakivasilaki (Jan 11, 2019)

C5455 said:


> I picked a random ip address from the /64 assigned to me.
> 
> 
> ```
> ...


try this:

```
ipv6_default_interface="vmx0"
ifconfig_vmx0_ipv6="inet6 2a00:6d40:72:xxxx::1/64 accept_rtadv"
ipv6_defaultrouter="fe80::1%vmx0"
```


----------

