# IPv4 + IPv6



## rainer_d (Jan 15, 2018)

Hi,

I'm trying to implement IPv6.

In my current setup, ipv4+ipv6 are on different NICs.

I can ping6 the gateway, but not beyond.

The inet6 fe80 address ist
fe80::250:56ff:fe87:5a8d%vmx1

I've set this the default router via

ipv6_defaultrouter="fe80::250:56ff:fe87:5a8d%vmx1"

This is somewhat similar to my hosts at Hetzner, where IPv6 works flawlessly. 

However, I can't ping6 outside here.


What am I missing?


----------



## SirDice (Jan 15, 2018)

The fe80::/10 addresses are link-local and are not routable. You need to put a "proper" IPv6 global address on the interface.

https://en.wikipedia.org/wiki/Link-local_address#IPv6


----------



## gkontos (Jan 15, 2018)

True however, fe80:1 is a valid IPv6 gateway used by many providers.


----------



## rainer_d (Jan 15, 2018)

Yes, I have a valid IP address on the interface, too.

```
ifconfig_vmx0="inet 212.71.110.51 netmask 255.255.255.0"
ifconfig_vmx1_ipv6="inet6 2a00:fb01:101::212:71:110:51"

ipv6_defaultrouter="fe80::250:56ff:fe87:5a8d%vmx1"
defaultrouter="212.71.110.1"
```


```
vmx1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,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:87:5a:8d
        hwaddr 00:50:56:87:5a:8d
        inet6 fe80::250:56ff:fe87:5a8d%vmx1 prefixlen 64 scopeid 0x2
        inet6 2a00:fb01:101:0:212:71:110:51 prefixlen 64
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet a
```


----------



## SirDice (Jan 15, 2018)

Your ipv6_defaultrouter is pointing to the link-local address of vmx1 and not the actual gateway address.


----------



## SirDice (Jan 15, 2018)

gkontos said:


> True however, fe80:1 is a valid IPv6 gateway used by many providers.


Correct. But you still require a global IPv6 address on the interface. The original post only showed a link-local address for vmx1.


----------



## rainer_d (Jan 15, 2018)

I know. But it does not make a difference:

```
# ping6 -c 5 2a00:fb01:101:0:212:71:110:1
PING6(56=40+8+8 bytes) 2a00:fb01:101:0:212:71:110:51 --> 2a00:fb01:101:0:212:71:110:1
16 bytes from 2a00:fb01:101:0:212:71:110:1, icmp_seq=0 hlim=64 time=0.452 ms
16 bytes from 2a00:fb01:101:0:212:71:110:1, icmp_seq=1 hlim=64 time=0.422 ms
16 bytes from 2a00:fb01:101:0:212:71:110:1, icmp_seq=2 hlim=64 time=0.529 ms
16 bytes from 2a00:fb01:101:0:212:71:110:1, icmp_seq=3 hlim=64 time=0.484 ms
16 bytes from 2a00:fb01:101:0:212:71:110:1, icmp_seq=4 hlim=64 time=0.416 ms

--- 2a00:fb01:101:0:212:71:110:1 ping6 statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.416/0.461/0.529/0.042 ms



 # netstat -rn                           
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            212.71.110.1       UGS        vmx0
127.0.0.1          link#3             UH          lo0
212.71.110.0/24    link#1             U          vmx0
212.71.110.51      link#1             UHS         lo0

Internet6:
Destination                       Gateway                       Flags     Netif Expire
::/96                             ::1                           UGRS        lo0
default                           fe80::1%vmx0                  UGS        vmx0
::1                               link#3                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
2a00:fb01:101::/64                link#2                        U          vmx1
2a00:fb01:101:0:212:71:110:51     link#2                        UHS         lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%vmx0/64                    link#1                        U          vmx0
fe80::250:56ff:fe87:374f%vmx0     link#1                        UHS         lo0
fe80::%vmx1/64                    link#2                        U          vmx1
fe80::250:56ff:fe87:5a8d%vmx1     link#2                        UHS         lo0
fe80::%lo0/64                     link#3                        U           lo0
fe80::1%lo0                       link#3                        UHS         lo0
ff02::/16                         ::1                           UGRS        lo0
```


So, the default route for v6 is still glued to vmx0. This is not good.
After hard-coding the actual v6 gateway and rebooting, it works now.

D'oh.


----------



## rainer_d (Jan 15, 2018)

Thanks a lot, guys.


----------



## SirDice (Jan 15, 2018)

Why are you splitting them up onto different interfaces? It's perfectly fine and valid to dual-stack a single interface.


----------



## rainer_d (Jan 15, 2018)

Beause it's a VM and it's different VLANs. Network people want the ipv6 VLANs away from the rest of the network (more or less). It's even a dedicated interface on the vmware-host.


On my Hetzner-Hosts, it's all on one interface.


----------



## SirDice (Jan 15, 2018)

rainer_d said:


> Beause it's a VM and it's different VLANs. Network people want the ipv6 VLANs away from the rest of the network (more or less). It's even a dedicated interface on the vmware-host.


Ah, right. That makes sort of sense (it's not something I would have done but it's not my network  ).


----------

