IPv6 - eth0 on loopback
Posted: 2018/07/22 16:46:33
Hi,
i have some trouble with ipv4 and ipv6 dual stack on my centos box. I think it isn't right, that my IPv6 addresses from eth0 was routed via loopback in the IPv6 routing-table. But/And i don't know why. Here are the facts:
First, the CentOS version i use:
root@computer:/home/john# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)
The following three scripts are the CentOS Network Configuration Scripts in generally
used by the system with and without NetworkManager. I don't use NetworkManager:
The meta network config-script:
root@computer:/home/john# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
GATEWAYDEV=eth0
GATEWAY=xxx.xxx.xxx.1
IPV6_DEFAULTGW=xxxx:xxxx::1
IPV6_AUTOTUNNEL=no
NOZEROCONF=true
I have two IPv4 addresses, that is the reason why there are ifcfg-eth0 and ifcfg-eth0:1.
ifcfg-eth0 has also the two IPv6 addresses. if-cfg-eth0:1 has only the second IPv4 address:
root@computer:/home/john# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=no
USERCTL=no
TYPE=Ethernet
IPADDR=xxx.xxx.xxx.2
NETMASK=255.255.255.0
GATEWAY=xxx.xxx.xxx.1
DEFROUTE=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6ADDR=xxxx:xxxx::2/64
IPV6ADDR_SECONDARIES=xxxx:xxxx::3/64
IPV6_DEFAULTGW=xxxx:xxxx::1
IPV6_DEFAULTDEV=eth0
PEERDNS=no
PEERROUTES=no
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
DNS1=127.0.0.1
DNS2=::1
root@computer:/home/john# cat /etc/sysconfig/network-scripts/ifcfg-eth0:1
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=xxx.xxx.xxx.3
NETMASK=255.255.255.0
After the System has started, the following IP settings are made:
root@computer:/home/john# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
inet xxx.xxx.xxx.2/24 brd xxx.xxx.xxx.255 scope global eth0 <- The first IPv4 Address
valid_lft forever preferred_lft forever
inet xxx.xxx.xxx.3/24 brd xxx.xxx.xxx.255 scope global eth0 <- The second IPv4 Address
valid_lft forever preferred_lft forever
inet6 xxxx:xxxx::2/64 scope global <- The first IPv6 Address
valid_lft forever preferred_lft forever
inet6 xxxx:xxxx::3/64 scope global <- The second IPv6 Address
valid_lft forever preferred_lft forever
inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link
valid_lft forever preferred_lft forever
.. and the routing-table (first IPv4 and then IPv6):
root@computer:/home/john# route -4n
Kernel IP Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
0.0.0.0 xxx.xxx.xxx.1 0.0.0.0 UG 0 0 0 eth0
xxx.xxx.xxx.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 <- First IPv4 Network
xxx.xxx.xxx.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 <- Second IPv4 Network
everything ist fine and is working on IPv4 layer.
Now comes the IPv6 routing-table:
root@computer:/home/john# route -6n
Kernel IPv6 Routentabelle
Destination Next Hop Flag Met Ref Use If
::/96 :: !n 1024 0 0 lo
0.0.0.0/96 :: !n 1024 0 0 lo
2002:a00::/24 :: !n 1024 0 0 lo
2002:7f00::/24 :: !n 1024 0 0 lo
2002:a9fe::/32 :: !n 1024 0 0 lo
2002:ac10::/28 :: !n 1024 0 0 lo
2002:c0a8::/32 :: !n 1024 0 0 lo
2002:e000::/19 :: !n 1024 0 0 lo
2a0a:51c0::/64 :: U 256 1 7 eth0
3ffe:ffff::/32 :: !n 1024 0 0 lo
fe80::/64 :: U 256 0 0 eth0
::/0 xxxx:xxxx::1 UG 1 1 217 eth0
::/0 :: !n -1 1 351 lo
::1/128 :: Un 0 2 63 lo
xxxx:xxxx::2/128 :: Un 0 2 2 lo
xxxx:xxxx::3/128 :: Un 0 2 660 lo
fe80::xxxx:xxxx:xxxx:xxxx/128 :: Un 0 1 0 lo
ff00::/8 :: U 256 1 7079 eth0
::/0 :: !n -1 1 351 lo
That it is, what i'm not understand. In the routing table both IPv6 addresses stands on
loopback device and not on my eth0 ethernet-card.
I think similar in the IPv4 routing table, the IP must have an relation between the device (eth0) and the
address. And has eth0 and not lo.
The result is: i can't ping IPv6 Adresses. In example ipv6.google.com:
root@computer:/home/john# ping6 -c4 ipv6.google.com
PING ipv6.google.com(fra15s18-in-x0e.1e100.net (2a00:1450:4001:81d::200e)) 56 data bytes
From computer (xxxx.xxxx::2) icmp_seq=1 Destination unreachable: Address unreachable
From computer (xxxx.xxxx::2) icmp_seq=2 Destination unreachable: Address unreachable
From computer (xxxx.xxxx::2) icmp_seq=3 Destination unreachable: Address unreachable
From computer (xxxx.xxxx::2) icmp_seq=4 Destination unreachable: Address unreachable
--- ipv6.google.com ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3001ms
.. my IPv6 Gateway:
root@computer:/home/john# ping6 -c4 xxxx:xxxx::1
PING xxxx:xxxx::1(xxxx:xxxx::1) 56 data bytes
From xxxx:xxxx::2 icmp_seq=1 Destination unreachable: Address unreachable
From xxxx:xxxx::2 icmp_seq=2 Destination unreachable: Address unreachable
From xxxx:xxxx::2 icmp_seq=3 Destination unreachable: Address unreachable
From xxxx:xxxx::2 icmp_seq=4 Destination unreachable: Address unreachable
--- xxxx:xxxx::1 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3000ms
At last, the localhost on loopback. So i think in principle IPv6 is working on the
maschine:
root@computer:/home/john# ping6 -c4 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.058 ms
64 bytes from ::1: icmp_seq=2 ttl=64 time=0.064 ms
64 bytes from ::1: icmp_seq=3 ttl=64 time=0.066 ms
64 bytes from ::1: icmp_seq=4 ttl=64 time=0.077 ms
--- ::1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.058/0.066/0.077/0.009 ms
With IPv4 now everything is working, but not with IPv6. I don't want to use NetworkManager, so i deactivate it before. There are 4 IP addresses, 2 IPv4 and 2 IPv6 in dual stack on one network interface card. I don't understand why IPv6 don't work.
thanks for your attention.
i have some trouble with ipv4 and ipv6 dual stack on my centos box. I think it isn't right, that my IPv6 addresses from eth0 was routed via loopback in the IPv6 routing-table. But/And i don't know why. Here are the facts:
First, the CentOS version i use:
root@computer:/home/john# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)
The following three scripts are the CentOS Network Configuration Scripts in generally
used by the system with and without NetworkManager. I don't use NetworkManager:
The meta network config-script:
root@computer:/home/john# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
GATEWAYDEV=eth0
GATEWAY=xxx.xxx.xxx.1
IPV6_DEFAULTGW=xxxx:xxxx::1
IPV6_AUTOTUNNEL=no
NOZEROCONF=true
I have two IPv4 addresses, that is the reason why there are ifcfg-eth0 and ifcfg-eth0:1.
ifcfg-eth0 has also the two IPv6 addresses. if-cfg-eth0:1 has only the second IPv4 address:
root@computer:/home/john# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=no
USERCTL=no
TYPE=Ethernet
IPADDR=xxx.xxx.xxx.2
NETMASK=255.255.255.0
GATEWAY=xxx.xxx.xxx.1
DEFROUTE=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6ADDR=xxxx:xxxx::2/64
IPV6ADDR_SECONDARIES=xxxx:xxxx::3/64
IPV6_DEFAULTGW=xxxx:xxxx::1
IPV6_DEFAULTDEV=eth0
PEERDNS=no
PEERROUTES=no
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
DNS1=127.0.0.1
DNS2=::1
root@computer:/home/john# cat /etc/sysconfig/network-scripts/ifcfg-eth0:1
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=xxx.xxx.xxx.3
NETMASK=255.255.255.0
After the System has started, the following IP settings are made:
root@computer:/home/john# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
inet xxx.xxx.xxx.2/24 brd xxx.xxx.xxx.255 scope global eth0 <- The first IPv4 Address
valid_lft forever preferred_lft forever
inet xxx.xxx.xxx.3/24 brd xxx.xxx.xxx.255 scope global eth0 <- The second IPv4 Address
valid_lft forever preferred_lft forever
inet6 xxxx:xxxx::2/64 scope global <- The first IPv6 Address
valid_lft forever preferred_lft forever
inet6 xxxx:xxxx::3/64 scope global <- The second IPv6 Address
valid_lft forever preferred_lft forever
inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link
valid_lft forever preferred_lft forever
.. and the routing-table (first IPv4 and then IPv6):
root@computer:/home/john# route -4n
Kernel IP Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
0.0.0.0 xxx.xxx.xxx.1 0.0.0.0 UG 0 0 0 eth0
xxx.xxx.xxx.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 <- First IPv4 Network
xxx.xxx.xxx.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 <- Second IPv4 Network
everything ist fine and is working on IPv4 layer.
Now comes the IPv6 routing-table:
root@computer:/home/john# route -6n
Kernel IPv6 Routentabelle
Destination Next Hop Flag Met Ref Use If
::/96 :: !n 1024 0 0 lo
0.0.0.0/96 :: !n 1024 0 0 lo
2002:a00::/24 :: !n 1024 0 0 lo
2002:7f00::/24 :: !n 1024 0 0 lo
2002:a9fe::/32 :: !n 1024 0 0 lo
2002:ac10::/28 :: !n 1024 0 0 lo
2002:c0a8::/32 :: !n 1024 0 0 lo
2002:e000::/19 :: !n 1024 0 0 lo
2a0a:51c0::/64 :: U 256 1 7 eth0
3ffe:ffff::/32 :: !n 1024 0 0 lo
fe80::/64 :: U 256 0 0 eth0
::/0 xxxx:xxxx::1 UG 1 1 217 eth0
::/0 :: !n -1 1 351 lo
::1/128 :: Un 0 2 63 lo
xxxx:xxxx::2/128 :: Un 0 2 2 lo
xxxx:xxxx::3/128 :: Un 0 2 660 lo
fe80::xxxx:xxxx:xxxx:xxxx/128 :: Un 0 1 0 lo
ff00::/8 :: U 256 1 7079 eth0
::/0 :: !n -1 1 351 lo
That it is, what i'm not understand. In the routing table both IPv6 addresses stands on
loopback device and not on my eth0 ethernet-card.
I think similar in the IPv4 routing table, the IP must have an relation between the device (eth0) and the
address. And has eth0 and not lo.
The result is: i can't ping IPv6 Adresses. In example ipv6.google.com:
root@computer:/home/john# ping6 -c4 ipv6.google.com
PING ipv6.google.com(fra15s18-in-x0e.1e100.net (2a00:1450:4001:81d::200e)) 56 data bytes
From computer (xxxx.xxxx::2) icmp_seq=1 Destination unreachable: Address unreachable
From computer (xxxx.xxxx::2) icmp_seq=2 Destination unreachable: Address unreachable
From computer (xxxx.xxxx::2) icmp_seq=3 Destination unreachable: Address unreachable
From computer (xxxx.xxxx::2) icmp_seq=4 Destination unreachable: Address unreachable
--- ipv6.google.com ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3001ms
.. my IPv6 Gateway:
root@computer:/home/john# ping6 -c4 xxxx:xxxx::1
PING xxxx:xxxx::1(xxxx:xxxx::1) 56 data bytes
From xxxx:xxxx::2 icmp_seq=1 Destination unreachable: Address unreachable
From xxxx:xxxx::2 icmp_seq=2 Destination unreachable: Address unreachable
From xxxx:xxxx::2 icmp_seq=3 Destination unreachable: Address unreachable
From xxxx:xxxx::2 icmp_seq=4 Destination unreachable: Address unreachable
--- xxxx:xxxx::1 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3000ms
At last, the localhost on loopback. So i think in principle IPv6 is working on the
maschine:
root@computer:/home/john# ping6 -c4 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.058 ms
64 bytes from ::1: icmp_seq=2 ttl=64 time=0.064 ms
64 bytes from ::1: icmp_seq=3 ttl=64 time=0.066 ms
64 bytes from ::1: icmp_seq=4 ttl=64 time=0.077 ms
--- ::1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.058/0.066/0.077/0.009 ms
With IPv4 now everything is working, but not with IPv6. I don't want to use NetworkManager, so i deactivate it before. There are 4 IP addresses, 2 IPv4 and 2 IPv6 in dual stack on one network interface card. I don't understand why IPv6 don't work.
thanks for your attention.