Configure IPv6 on Debian 9
Solution 1
There is an error in your configuration. Your gateway is not within your subnet range.
The range for subnet 2001:41d0:2:fa3e::/64
is 2001:41d0:0002:fa3e:0000:0000:0000:0000
- 2001:41d0:0002:fa3e:ffff:ffff:ffff:ffff
. However, 2001:41d0:2:faff:ff:ff:ff:ff
falls outside that range.
An example of a working config:
iface eth0 inet6 static
address 2001:db8:7927::61
netmask 64
gateway 2001:db8:7927::1
An additional problem could be that you configured an IPv4 address on ens3
and the IPv6 address on eth0
. This might be intentional, but something that could easily be missed.
Solution 2
The OVH help document for IPv6 explains that you need to add static routes for your IPv6 gateway, because it is outside the IPv6 subnet allocated to your server.
So your interfaces file should contain, in relevant part:
iface ens3 inet6 static
address 2001:41d0:2:fa3e::2
netmask 128
post-up /sbin/ip -f inet6 route add 2001:41d0:2:faff:ff:ff:ff:ff dev ens3
post-up /sbin/ip -f inet6 route add default via 2001:41d0:2:faff:ff:ff:ff:ff
pre-down /sbin/ip -f inet6 route del 2001:41d0:2:faff:ff:ff:ff:ff dev ens3
pre-down /sbin/ip -f inet6 route del default via 2001:41d0:2:faff:ff:ff:ff:ff
Related videos on Youtube
J.Doe
Updated on September 18, 2022Comments
-
J.Doe over 1 year
Help set up IPv6 on Deban 9 My IPv6 confuration don't work:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug ens3 iface ens3 inet static address 217.182.53.46/24 gateway 217.182.53.254 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 8.8.8.8 77.88.8.8 dns-search 8.8.8.8 iface ens3 inet6 static address 2001:41d0:2:fa3e::2/64 netmask 64 gateway 2001:41d0:2:faff:ff:ff:ff:ff
How fix it?
IPv6: 2001:41d0:2:fa3e::2/64
GW: 2001:41d0:2:faff:ff:ff:ff:ff
-
user1686 over 5 yearsWhile unusual, it's not technically impossible for the gateway to be off-subnet – and several server hosting companies actually do that.
-
J.Doe over 5 yearsYes. The correct manual