I'm having problems trying to add an ipv6 subnet, or even a single address, to my server. I have a /64 assigned, and my gateway is on a /48. I can get ipv6 internet access working with a few different configurations, but I can't get a working second address or subnet. I'm pretty certain it's a routing problem, and I'm not sure what else to try at this point.
Warning..(and apologies) this is a long post! I decided to overshare rather than not include something. I numbered each configuration attempt, so hopefully that helps keep it organized.
# 1
Doesn't get an ipv6 address.
# 2
Doesn't work.
# 3
I asked my provider and they gave me the gateway below.
It looks like the gateway doesn't get added to the routing table, maybe because it's a different subnet.
I can get ipv6 connectivity if I manually add the route.
# 4
Changed my address to /48 (even though it's /64).
Connection works, but I cannot get a 2nd address working.
Add a second address.
# 5
Using the link local address. Again, it appears the gateway doesn't get added to the routing table.
# 6
Using static routes. It works, but I can't add an address.
Adding an address.
# 7
2 static routes, and added ::2 address alias
# 8
Static routes with gateway subnet, and default interface.
# 9
Using different gateway link local address.
Getting the address.
# 10
Static routes with link local address.
Warning..(and apologies) this is a long post! I decided to overshare rather than not include something. I numbered each configuration attempt, so hopefully that helps keep it organized.
Code:
uname -a
FreeBSD george 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
# 1
Doesn't get an ipv6 address.
Code:
vi /etc/rc.conf
ifconfig_vtnet0_ipv6="inet6 accept_rtadv"
rtsold_enable="YES"
# 2
Doesn't work.
Code:
vi /etc/rc.conf
ifconfig_vtnet0_ipv6="inet6 2602:fed2:7116:706b::1/64"
ipv6_defaultrouter="fe80::1%vtnet0"
# 3
I asked my provider and they gave me the gateway below.
Code:
vi /etc/rc.conf
ifconfig_vtnet0_ipv6="inet6 2602:fed2:7116:706b::1/64"
ipv6_defaultrouter="2602:fed2:7116::1"
ifconfig -a inet6
vtnet0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
options=4c07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,TXCSUM_IPV6>
inet6 fe80::216:3eff:feac:4cea%vtnet0 prefixlen 64 scopeid 0x1
inet6 2602:fed2:7116:706b::1 prefixlen 64
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ping -6 -c3 google.com
ping: UDP connect: No route to host
netstat -rn6
Internet6:
Destination Gateway Flags Netif Expire
::/96 link#2 URS lo0
::1 link#2 UHS lo0
::ffff:0.0.0.0/96 link#2 URS lo0
2602:fed2:7116:706b::/64 link#1 U vtnet0
2602:fed2:7116:706b::1 link#2 UHS lo0
fe80::%lo0/10 link#2 URS lo0
fe80::%vtnet0/64 link#1 U vtnet0
fe80::216:3eff:feac:4cea%lo0 link#2 UHS lo0
fe80::%lo0/64 link#2 U lo0
fe80::1%lo0 link#2 UHS lo0
ff02::/16 link#2 URS lo0
It looks like the gateway doesn't get added to the routing table, maybe because it's a different subnet.
I can get ipv6 connectivity if I manually add the route.
Code:
doas route -6 add 2602:fed2:7116::1 -iface vtnet0
doas route -6 add default 2602:fed2:7116::1
# 4
Changed my address to /48 (even though it's /64).
Connection works, but I cannot get a 2nd address working.
Code:
vi /etc/rc.conf
ifconfig_vtnet0_ipv6="inet6 2602:fed2:7116:706b::1/48"
ipv6_defaultrouter="2602:fed2:7116::1"
ifconfig -a inet6
vtnet0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
options=4c07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,TXCSUM_IPV6>
inet6 fe80::216:3eff:feac:4cea%vtnet0 prefixlen 64 scopeid 0x1
inet6 2602:fed2:7116:706b::1 prefixlen 48
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ping -6 -c3 google.com
PING(56=40+8+8 bytes) 2602:fed2:7116:706b::1 --> 2607:f8b0:4023:1002::66
16 bytes from 2607:f8b0:4023:1002::66, icmp_seq=0 hlim=109 time=5.298 ms
16 bytes from 2607:f8b0:4023:1002::66, icmp_seq=1 hlim=109 time=8.998 ms
16 bytes from 2607:f8b0:4023:1002::66, icmp_seq=2 hlim=109 time=4.951 ms
--- google.com ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 4.951/6.416/8.998/1.831 ms
Add a second address.
Code:
doas ifconfig vtnet0 inet6 2602:fed2:7116:706b::2/48 alias
## results are the same if I use '...::2/64 alias'
ping -S 2602:fed2:7116:706b::2 -6 -c3 google.com
PING(56=40+8+8 bytes) 2602:fed2:7116:706b::2 --> 2607:f8b0:4023:1002::66
--- google.com ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
netstat -rn6
Internet6:
Destination Gateway Flags Netif Expire
::/96 link#2 URS lo0
default 2602:fed2:7116::1 UGS vtnet0
::1 link#2 UHS lo0
::ffff:0.0.0.0/96 link#2 URS lo0
2602:fed2:7116::/48 link#1 U vtnet0
2602:fed2:7116:706b::1 link#2 UHS lo0
2602:fed2:7116:706b::2 link#2 UHS lo0
fe80::%lo0/10 link#2 URS lo0
fe80::%vtnet0/64 link#1 U vtnet0
fe80::216:3eff:feac:4cea%lo0 link#2 UHS lo0
fe80::%lo0/64 link#2 U lo0
fe80::1%lo0 link#2 UHS lo0
ff02::/16 link#2 URS lo0
# 5
Using the link local address. Again, it appears the gateway doesn't get added to the routing table.
Code:
vi /etc/rc.conf
ipv6_ifconfig_vtnet0="fe80::216:3eff:feac:4cea%vtnet0"
ifconfig_vtnet0_alias0="inet6 2602:fed2:7116:706b::1/64"
ipv6_defaultrouter="2602:fed2:7116::1"
ipv6_gateway_enable="YES"
ping -6 -c3 google.com
ping: UDP connect: No route to host
netstat -rn6
Internet6:
Destination Gateway Flags Netif Expire
::/96 link#2 URS lo0
::1 link#2 UHS lo0
::ffff:0.0.0.0/96 link#2 URS lo0
2602:fed2:7116:706b::/64 link#1 U vtnet0
2602:fed2:7116:706b::1 link#2 UHS lo0
fe80::%lo0/10 link#2 URS lo0
fe80::%vtnet0/64 link#1 U vtnet0
fe80::216:3eff:feac:4cea%lo0 link#2 UHS lo0
fe80::%lo0/64 link#2 U lo0
fe80::1%lo0 link#2 UHS lo0
ff02::/16 link#2 URS lo0
# 6
Using static routes. It works, but I can't add an address.
Code:
vi /etc/rc.conf
ifconfig_vtnet0_ipv6="inet6 2602:fed2:7116:706b::1/64"
ipv6_static_routes="vps1"
ipv6_route_vps1="2602:fed2:7116::1 -iface vtnet0"
ipv6_defaultrouter="2602:fed2:7116::1"
ping -6 -c3 google.com
PING(56=40+8+8 bytes) 2602:fed2:7116:706b::1 --> 2607:f8b0:4023:1004::8a
16 bytes from 2607:f8b0:4023:1004::8a, icmp_seq=0 hlim=111 time=4.148 ms
16 bytes from 2607:f8b0:4023:1004::8a, icmp_seq=1 hlim=111 time=10.082 ms
16 bytes from 2607:f8b0:4023:1004::8a, icmp_seq=2 hlim=111 time=5.093 ms
--- google.com ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 4.148/6.441/10.082/2.604 ms
netstat -rn6
Internet6:
Destination Gateway Flags Netif Expire
::/96 link#2 URS lo0
default 2602:fed2:7116::1 UGS vtnet0
::1 link#2 UHS lo0
::ffff:0.0.0.0/96 link#2 URS lo0
2602:fed2:7116::1 link#1 UHS vtnet0
2602:fed2:7116:706b::/64 link#1 U vtnet0
2602:fed2:7116:706b::1 link#2 UHS lo0
fe80::%lo0/10 link#2 URS lo0
fe80::%vtnet0/64 link#1 U vtnet0
fe80::216:3eff:feac:4cea%lo0 link#2 UHS lo0
fe80::%lo0/64 link#2 U lo0
fe80::1%lo0 link#2 UHS lo0
ff02::/16 link#2 URS lo0
Adding an address.
Code:
vi /etc/rc.conf
ifconfig_vtnet0_ipv6="inet6 2602:fed2:7116:706b::1/64"
ifconfig_vtnet0_alias0="inet6 2602:fed2:7116:706b::2/64"
ipv6_static_routes="vps1"
ipv6_route_vps1="2602:fed2:7116::1 -iface vtnet0"
ipv6_defaultrouter="2602:fed2:7116::1"
ping -6 -S 2602:fed2:7116:706b::2 -c3 google.com
PING(56=40+8+8 bytes) 2602:fed2:7116:706b::2 --> 2607:f8b0:4023:1002::64
--- google.com ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
netstat -rn6
Internet6:
Destination Gateway Flags Netif Expire
::/96 link#2 URS lo0
default 2602:fed2:7116::1 UGS vtnet0
::1 link#2 UHS lo0
::ffff:0.0.0.0/96 link#2 URS lo0
2602:fed2:7116::1 link#1 UHS vtnet0
2602:fed2:7116:706b::/64 link#1 U vtnet0
2602:fed2:7116:706b::1 link#2 UHS lo0
2602:fed2:7116:706b::2 link#2 UHS lo0
fe80::%lo0/10 link#2 URS lo0
fe80::%vtnet0/64 link#1 U vtnet0
fe80::216:3eff:feac:4cea%lo0 link#2 UHS lo0
fe80::%lo0/64 link#2 U lo0
fe80::1%lo0 link#2 UHS lo0
ff02::/16 link#2 URS lo0
# 7
2 static routes, and added ::2 address alias
Code:
vi /etc/rc.conf
ifconfig_vtnet0_ipv6="inet6 2602:fed2:7116:706b::1/64"
ifconfig_vtnet0_alias0="inet6 2602:fed2:7116:706b::2/64"
ipv6_static_routes="vps1 vps2"
ipv6_route_vps1="2602:fed2:7116::1 -iface vtnet0"
ipv6_route_vps2="2602:fed2:7116:706b::1 -iface vtnet0"
ipv6_defaultrouter="2602:fed2:7116::1"
ping -6 -S 2602:fed2:7116:706b::2 -c3 google.com
PING(56=40+8+8 bytes) 2602:fed2:7116:706b::2 --> 2607:f8b0:4023:1002::65
--- google.com ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
netstat -rn6
Internet6:
Destination Gateway Flags Netif Expire
::/96 link#2 URS lo0
default 2602:fed2:7116::1 UGS vtnet0
::1 link#2 UHS lo0
::ffff:0.0.0.0/96 link#2 URS lo0
2602:fed2:7116::1 link#1 UHS vtnet0
2602:fed2:7116:706b::/64 link#1 U vtnet0
2602:fed2:7116:706b::1 link#2 UHS lo0
2602:fed2:7116:706b::2 link#2 UHS lo0
fe80::%lo0/10 link#2 URS lo0
fe80::%vtnet0/64 link#1 U vtnet0
fe80::216:3eff:feac:4cea%lo0 link#2 UHS lo0
fe80::%lo0/64 link#2 U lo0
fe80::1%lo0 link#2 UHS lo0
ff02::/16 link#2 URS lo0
# 8
Static routes with gateway subnet, and default interface.
Code:
vi /etc/rc.conf
ifconfig_vtnet0_ipv6="inet6 2602:fed2:7116:706b::1/64"
ifconfig_vtnet0_alias0="inet6 2602:fed2:7116:706b::2/64"
ipv6_static_routes="vps"
ipv6_route_vps="2602:fed2:7116:: -prefixlen 48 -iface vtnet0"
ipv6_defaultrouter="2602:fed2:7116::1"
ipv6_default_interface="vtnet0"
ping -6 -S 2602:fed2:7116:706b::2 -c3 google.com
PING(56=40+8+8 bytes) 2602:fed2:7116:706b::2 --> 2607:f8b0:4023:1002::66
--- google.com ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
netstat -rn6
Internet6:
Destination Gateway Flags Netif Expire
::/96 link#2 URS lo0
default 2602:fed2:7116::1 UGS vtnet0
::1 link#2 UHS lo0
::ffff:0.0.0.0/96 link#2 URS lo0
2602:fed2:7116::/48 link#1 US vtnet0
2602:fed2:7116:706b::/64 link#1 U vtnet0
2602:fed2:7116:706b::1 link#2 UHS lo0
2602:fed2:7116:706b::2 link#2 UHS lo0
fe80::%lo0/10 link#2 URS lo0
fe80::%vtnet0/64 link#1 U vtnet0
fe80::216:3eff:feac:4cea%lo0 link#2 UHS lo0
fe80::%lo0/64 link#2 U lo0
fe80::1%lo0 link#2 UHS lo0
ff02::/16 link#2 URS lo0
# 9
Using different gateway link local address.
Getting the address.
Code:
ping -6 ff02::2%vtnet0
PING(56=40+8+8 bytes) fe80::216:3eff:feac:4cea%vtnet0 --> ff02::2%vtnet0
16 bytes from fe80::ae1f:6bff:feac:5af%vtnet0, icmp_seq=0 hlim=64 time=0.755 ms
Code:
vi /etc/rc.conf
ifconfig_vtnet0_ipv6="inet6 2602:fed2:7116:706b::1/64"
ipv6_defaultrouter="fe80::ae1f:6bff:feac:5af%vtnet0"
ping -6 -c3 google.com
PING(56=40+8+8 bytes) 2602:fed2:7116:706b::1 --> 2607:f8b0:4023:1004::64
--- google.com ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
Internet6:
Destination Gateway Flags Netif Expire
::/96 link#2 URS lo0
default fe80::ae1f:6bff:feac:5af%vtnet0 UGS vtnet0
::1 link#2 UHS lo0
::ffff:0.0.0.0/96 link#2 URS lo0
2602:fed2:7116:706b::/64 link#1 U vtnet0
2602:fed2:7116:706b::1 link#2 UHS lo0
fe80::%lo0/10 link#2 URS lo0
fe80::%vtnet0/64 link#1 U vtnet0
fe80::216:3eff:feac:4cea%lo0 link#2 UHS lo0
fe80::%lo0/64 link#2 U lo0
fe80::1%lo0 link#2 UHS lo0
ff02::/16 link#2 URS lo0
# 10
Static routes with link local address.
Code:
vi /etc/rc.conf
ifconfig_vtnet0_ipv6="inet6 2602:fed2:7116:706b::1/64"
ifconfig_vtnet0_alias0="inet6 2602:fed2:7116:706b::2/64"
ipv6_static_routes="vps"
ipv6_route_vps="fe80::ae1f:6bff:feac:5af -iface vtnet0"
ipv6_defaultrouter="fe80::ae1f:6bff:feac:5af%vtnet0"
ping -6 -c3 google.com
PING(56=40+8+8 bytes) 2602:fed2:7116:706b::1 --> 2607:f8b0:4023:1004::8b
--- google.com ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
netstat -rn6
Internet6:
Destination Gateway Flags Netif Expire
::/96 link#2 URS lo0
default fe80::ae1f:6bff:feac:5af%vtnet0 UGS vtnet0
::1 link#2 UHS lo0
::ffff:0.0.0.0/96 link#2 URS lo0
2602:fed2:7116:706b::/64 link#1 U vtnet0
2602:fed2:7116:706b::1 link#2 UHS lo0
2602:fed2:7116:706b::2 link#2 UHS lo0
fe80::%lo0/10 link#2 URS lo0
fe80::%vtnet0/64 link#1 U vtnet0
fe80::216:3eff:feac:4cea%lo0 link#2 UHS lo0
fe80::ae1f:6bff:feac:5af%vtnet0 link#1 UHS vtnet0
fe80::%lo0/64 link#2 U lo0
fe80::1%lo0 link#2 UHS lo0
ff02::/16 link#2 URS lo0