dual stack IPv4/IPv6 configuration via config drive broken for RHEL7
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Andreas Karis |
Bug Description
Currently, if a network interface has both IPv4 and IPv6 configuration information (via network_data.json), cloud-init creates separate aliases files for IPv4 (i.e. ifcfg-eth0:0) and IPv6 (ifcfg-eth0:1) network configuration information. This results in an error when attempting to ifup eth0:
/etc/sysconfig/
I believe this error is occurring because RHEL expects/requires an IPv4 address within any aliases file.
Red Hat documentation (https:/
Furthermore, it appears that multiple IPv6 addresses on the same interface should use the IPV6ADDR_
I believe this issue can be resolved by eliminating the use of alias files and instead configuring IPv4 and IPv6 within the primary interface file (i.e. ifcfg-eth0). Here's an example:
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=static
DEVICE=eth0
HWADDR=
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
DEFROUTE=yes
GATEWAY=
IPADDR=
NETMASK=
IPV6ADDR=
IPV6INIT=yes
IPV6_DEFAULTGW=
Related branches
- Scott Moser: Approve
- Server Team CI bot: Approve (continuous-integration)
-
Diff: 458 lines (+199/-132)3 files modifiedcloudinit/net/sysconfig.py (+174/-70)
tests/unittests/test_distros/test_netconfig.py (+3/-5)
tests/unittests/test_net.py (+22/-57)
- Server Team CI bot: Approve (continuous-integration)
- cloud-init Commiters: Pending requested
-
Diff: 453 lines (+194/-132)3 files modifiedcloudinit/net/sysconfig.py (+169/-70)
tests/unittests/test_distros/test_netconfig.py (+3/-5)
tests/unittests/test_net.py (+22/-57)
Changed in cloud-init: | |
assignee: | nobody → Andreas Karis (akaris) |
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in cloud-init: | |
status: | Confirmed → Fix Committed |
IPv6 routes are created in route- and handled the same as IPv4 routes. Bad syntax according to /usr/share/ doc/initscripts -9.49.37/ sysconfig. txt and hence IPv6 routes are not created.
/etc/sysconfig/ network- scripts/ route-< interface- name>
Contains lines that specify additional routes that should be added when the
associated interface is brought up.
The files are processed by the ifup-routes script and uses the /sbin/ipcalc
utility for all network masks and numbers. Routes are specified using the
syntax:
ADDRESSn= <network> <network/ prefix mask> <next-hop router/gateway IP address>
NETMASKn=
GATEWAYn=
The "n" is expected to be consecutive positive integers starting from 0.
For example:
ADDRESS0= 192.168. 2.0 255.255. 255.0 192.168. 1.1
NETMASK0=
GATEWAY0=
adds a network route to the 192.168.2.0 network via the gateway at
192.168.1.1. Since you must already have a route to the network of the
gateway, there is no need to specify a device.
Note: The ifup-routes script also supports an older syntax designed to be
used directly as an argument to "/sbin/ip route add".
If no "ADDRESSn" lines are found the following will still
work:
192.168.2.0/24 dev ppp0
adds a network route to the 192.168.2.0 network through ppp0.
/etc/sysconfig/ network- scripts/ route6- <interface- name>
Contains lines that are arguments to "/sbin/ip -6 route add"
For example:
site-local route for network fec0:0:0:2::/64
via gateway fec0:0:0:1:0:0:0:20 (e.g. on eth0):
fec0:0:0:2::/64 via fec0:0:0:1:0:0:0:20
additional prefix configured to be on-link on eth0:
3ffe: fffe:1: 2::/64 dev eth0
6to4 route for network 3ffe:ffff:1::/48, either:
3ffe:ffff:1::/48
3ffe:ffff:1::/48 via ::192.168.1.2
Note the special case of 6to4 interface: 'via [relay]' is
automatically added if explicit 'via' wasn't specified.
BOOTPROTO=static should be BOOTPROTO=none according to documentation
BOOTPROTO= none|bootp| dhcp
'bootp' or 'dhcp' cause a DHCP client to run on the device. Any other
value causes any static configuration in the file to be applied.