Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 44942  / 2 Years ago, thu, march 3, 2022, 9:04:38

I'm configuring a dual stack network on a KVM server using static IPv4 and IPv6 addresses furnished by my provider.



I input all addresses, nameservers and gateways as required when installing Ubuntu. After that, I checked the /etc/network/interfaces file and noticed that the IPv6 stanza was absent (an ifconfig execution confirmed this), so I added the relevant lines. This is the final file:



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 151.236.18.86
netmask 255.255.255.0
network 151.236.18.0
broadcast 151.236.18.255
gateway 151.236.18.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 91.227.204.227 91.227.205.227
dns-search mydomainname.com
iface eth0 inet6 static
pre-up modprobe ipv6
address 2001:b60:1000:151:236:18:86:0
netmask 112
gateway 2001:b60:1000::1
dns-nameservers 2001:4860:4860::8888 2001:4860:4860::8844
dns-search mydomainname.com


I then restarted networking via sudo /etc/init.d/networking stop && sudo /etc/init.d/networking restart and noticed that, while IPv4 was working, outbound IPv6 connectivity was not available (I did not check for inbound connectivity yet).



ifconfig and ip -6 addr show the IPv6 address is recognized:



eth0      Link encap:Ethernet  HWaddr 52:54:00:b1:27:87  
inet addr:151.236.18.86 Bcast:151.236.18.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:feb1:2787/64 Scope:Link
inet6 addr: 2001:b60:1000:151:236:18:86:0/112 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16409 errors:0 dropped:0 overruns:0 frame:0
TX packets:1178 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1126656 (1.1 MB) TX bytes:763658 (763.6 KB)

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 2001:b60:1000:151:236:18:86:0/112 scope global
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:feb1:2787/64 scope link
valid_lft forever preferred_lft forever


On the contrary, no default route exists for the IPv6 stack:



$ ip -6 route
2001:b60:1000:151:236:18:86:0/112 dev eth0 proto kernel metric 256
fe80::/64 dev eth0 proto kernel metric 256


Trying to add the missing route leads to "No route to host" error:



$ sudo ip -6 route add default via 2001:b60:1000::1
RTNETLINK answers: No route to host


What could be wrong, and how can I fix the network configuration so that I can get the IPv6 stack working?


More From » networking

 Answers
2

It turned out that the network mask length given to me by the provider was incorrect: the right one was 48. Changing it did the trick.


[#30090] Thursday, March 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terose

Total Points: 185
Total Questions: 125
Total Answers: 131

Location: Venezuela
Member since Mon, Dec 13, 2021
2 Years ago
terose questions
;