Why does the IPv6 route validation succeed when the ip address and gateway are the same?
Issue
- Using one of the locally assigned IPv6 addresses as gateway for a remote network should not be allowed
- Assigning the machine's own ip6 address as its default gateway results in the error below, which is expected:
# ip -6 r s dev eth0
fdde::1 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
fe80::/64 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
# ip -6 r a default via fdde::1
RTNETLINK answers: Invalid argument
However, the same when defined in the ifcfg configuration file doesn't throw any error, when in fact, the script uses the same 'ip route' command:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
IPV6INIT="yes"
ONBOOT="yes"
TYPE="Ethernet"
IPV6ADDR=fdde::1/128
IPV6_DEFAULTGW=fdde::1
# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0:
Determining IP information for eth0... done.
[ OK ]
# ip -6 route show dev eth0
fdde::1 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
fe80::/64 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
default via fdde::1 metric 1 mtu 1500 advmss 1440 hoplimit 4294967295
Environment
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- ipv6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.