Solved IPv6 static configuration

aragats

Daemon

Reaction score: 525
Messages: 1,256

Probably I'm missing something obvious, but this is just my second box with IPv6, never have dealt with it before. I cannot add a default gateway:
Code:
# route add -inet6 default xxxx:52c0:101::1
[b]route: writing to routing socket: Network is unreachable[/b]

$ ifconfig
vtnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
   options=6c07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
   ether 00:16:3c:c2:3a:9c
   inet x.x.73.241 netmask 0x5024900 broadcast 255.255.255.255
   inet6 fe80::216:3cff:fec2:3a9c%vtnet0 prefixlen 64 scopeid 0x1
   inet6 xxxx:52c0:101:307::b2a7 prefixlen 64
   nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
   media: Ethernet 10Gbase-T <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 0x2
   inet 127.0.0.1 netmask 0xff000000
   nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
   groups: lo

$ netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            5.2.73.1           UGS      vtnet0
x.x.73.0&0x5024900 link#1             U        vtnet0
x.x.73.241         link#1             UHS         lo0
127.0.0.1          link#2             UH          lo0

Internet6:
Destination                       Gateway                       Flags     Netif Expire
::/96                             ::1                           UGRS        lo0
::1                               link#2                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
xxxx:52c0:101:307::/64            link#1                        U        vtnet0
xxxx:52c0:101:307::b2a7           link#1                        UHS         lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%vtnet0/64                  link#1                        U        vtnet0
fe80::216:3cff:fec2:3a9c%vtnet0   link#1                        UHS         lo0
fe80::%lo0/64                     link#2                        U           lo0
fe80::1%lo0                       link#2                        UHS         lo0
ff02::/16                         ::1                           UGRS        lo0
Here is /etc/rc.conf:
Code:
....
ifconfig_vtnet0="inet x.x.73.241 netmask x.x.73.0"
ifconfig_vtnet0_ipv6="inet6 xxxx:52c0:101:307::b2a7/64"

defaultrouter="x.x.73.1"
ipv6_defaultrouter="xxxx:52c0:101::1"
....
Thanks for directions!
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,764
Messages: 30,893

Your gateway is outside of your subnet.
 
OP
OP
aragats

aragats

Daemon

Reaction score: 525
Messages: 1,256

Your gateway is outside of your subnet.
That was the VPS provider gives me...
Code:
Subnet       xxxx:52c0:101:307::/64
Gateway      xxxx:52c0:101::1
Nameserver   xxxx:1b0:7999:446::1:4
Nameserver   xxxx:1ca8:18::1:10
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,764
Messages: 30,893

Try this:
Code:
ipv6_defaultrouter="-iface vtnet0"
Not sure if it's going to work but it worked for me in similar situations.
 
OP
OP
aragats

aragats

Daemon

Reaction score: 525
Messages: 1,256

Just tried ipv6_defaultrouter="-iface vtnet0":
Code:
$ ping6 ipv6.google.com
PING6(56=40+8+8 bytes) xxxx:52c0:101:307::b2a7 --> 2a00:1450:400c:c04::8b
ping6: sendmsg: No buffer space available
ping6: wrote ipv6.l.google.com 16 chars, ret=-1
ping6: sendmsg: No buffer space available
Code:
$ ifconfig
vtnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
   options=6c07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
   ether 00:16:3c:c2:3a:9c
   inet x.x.73.241 netmask 0x5024900 broadcast 255.255.255.255
   inet6 fe80::216:3cff:fec2:3a9c%vtnet0 prefixlen 64 scopeid 0x1
   inet6 xxxx:52c0:101:307::b2a7 prefixlen 64
   nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
   media: Ethernet 10Gbase-T <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 0x2
   inet 127.0.0.1 netmask 0xff000000
   nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
   groups: lo

$ netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            5.2.73.1           UGS      vtnet0
x.x.73.0&0x5024900 link#1             U        vtnet0
x.x.73.241         link#1             UHS         lo0
127.0.0.1          link#2             UH          lo0

Internet6:
Destination                       Gateway                       Flags     Netif Expire
::/96                             ::1                           UGRS        lo0
default                           00:16:3c:c2:3a:9c             US       vtnet0
::1                               link#2                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
xxxx:52c0:101:307::/64            link#1                        U        vtnet0
xxxx:52c0:101:307::b2a7           link#1                        UHS         lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%vtnet0/64                  link#1                        U        vtnet0
fe80::216:3cff:fec2:3a9c%vtnet0   link#1                        UHS         lo0
fe80::%lo0/64                     link#2                        U           lo0
fe80::1%lo0                       link#2                        UHS         lo0
ff02::/16                         ::1                           UGRS        lo0
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,764
Messages: 30,893

Ok, that obviously doesn't work in your situation. Another gateway to try is fe80::1. That should be a common gateway address. Yes, that's a link-local address. You may need to specify it as "fe80::1%vtnet0".
 
OP
OP
aragats

aragats

Daemon

Reaction score: 525
Messages: 1,256

I've opened a ticket with the VPS provider, and they pointed to a document telling that although I have a /64 prefix assigned, I should use /48 netmask!
It works now!
Thanks!
 
Top