Will render:
| auto lo
| iface lo inet loopback
|
| auto iface0
| iface iface0 inet dhcp
| post-up ifup iface0:1
|
|
| auto iface0:1
| iface iface0:1 inet6 dhcp
Below is an example test case that shows the output.
Heres the problem:
$ sudo sh -c 'ifdown eth0; ifup eth0'
$ sudo sh -c 'ifdown eth0; ifup eth0'
Killed old client process
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth0/06:b3:0a:3a:2d:e3
Sending on LPF/eth0/06:b3:0a:3a:2d:e3
Sending on Socket/fallback
DHCPRELEASE on eth0 to 172.31.16.1 port 67 (xid=0x32b625f1)
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth0/06:b3:0a:3a:2d:e3
Sending on LPF/eth0/06:b3:0a:3a:2d:e3
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0xa4d5f301)
DHCPREQUEST of 172.31.29.161 on eth0 to 255.255.255.255 port 67 (xid=0x1f3d5a4)
DHCPOFFER of 172.31.29.161 from 172.31.16.1
DHCPACK of 172.31.29.161 from 172.31.16.1
bound to 172.31.29.161 -- renewal in 1801 seconds.
Failed to bring up eth0:1.
Failed to bring up eth0.
/bin/ip link set dev eth0:1 up
/lib/ifupdown/wait-for-ll6.sh
/sbin/dhclient -1 -6 -pf /run/dhclient6.eth0:1.pid -lf /var/lib/dhcp/dhclient6.eth0:1.leases -I -df /var/lib/dhcp/dhclient.eth0:1.leases eth0:1
--- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py
@@ -813,6 +813,27 @@ class TestEniRoundTrip(TestCase): self.assertEqual( expected, [line for line in found if line])
Currently, a config like this:
| version: 1
| config:
| - 'type': 'physical'
| 'name': 'iface0'
| 'subnets':
| - {'type': 'dhcp4'}
| - {'type': 'dhcp6'}
Will render:
| auto lo
| iface lo inet loopback
|
| auto iface0
| iface iface0 inet dhcp
| post-up ifup iface0:1
|
|
| auto iface0:1
| iface iface0:1 inet6 dhcp
Below is an example test case that shows the output. /www.isc. org/software/ dhcp/
Heres the problem:
$ sudo sh -c 'ifdown eth0; ifup eth0'
$ sudo sh -c 'ifdown eth0; ifup eth0'
Killed old client process
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https:/
Listening on LPF/eth0/ 06:b3:0a: 3a:2d:e3 06:b3:0a: 3a:2d:e3 /www.isc. org/software/ dhcp/
Sending on LPF/eth0/
Sending on Socket/fallback
DHCPRELEASE on eth0 to 172.31.16.1 port 67 (xid=0x32b625f1)
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https:/
Listening on LPF/eth0/ 06:b3:0a: 3a:2d:e3 06:b3:0a: 3a:2d:e3
Sending on LPF/eth0/
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0xa4d5f301)
DHCPREQUEST of 172.31.29.161 on eth0 to 255.255.255.255 port 67 (xid=0x1f3d5a4)
DHCPOFFER of 172.31.29.161 from 172.31.16.1
DHCPACK of 172.31.29.161 from 172.31.16.1
bound to 172.31.29.161 -- renewal in 1801 seconds.
Failed to bring up eth0:1.
Failed to bring up eth0.
$ sudo ifup -v eth0:1 interfaces. d/50-cloud- init.cfg interfaces. d/60-ipv6. cfg if-pre- up.d if-pre- up.d/ethtool if-pre- up.d/ifenslave if-pre- up.d/vlan conf.eth0: 1.accept_ ra=1
Parsing file /etc/network/
Parsing file /etc/network/
Configuring interface eth0:1=eth0:1 (inet6)
/bin/run-parts --exit-on-error --verbose /etc/network/
run-parts: executing /etc/network/
run-parts: executing /etc/network/
+ [ inet6 = meta ]
+ IF_BOND_SLAVES=
+ [ ]
+ [ ]
+ [ -z ]
+ exit
run-parts: executing /etc/network/
/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure.
/sbin/sysctl -q -e -w net.ipv6.
/bin/ip link set dev eth0:1 up wait-for- ll6.sh eth0:1. pid -lf /var/lib/ dhcp/dhclient6. eth0:1. leases -I -df /var/lib/ dhcp/dhclient. eth0:1. leases eth0:1
/lib/ifupdown/
/sbin/dhclient -1 -6 -pf /run/dhclient6.
--- a/tests/ unittests/ test_net. py unittests/ test_net. py p(TestCase) :
self. assertEqual(
expected, [line for line in found if line])
+++ b/tests/
@@ -813,6 +813,27 @@ class TestEniRoundTri
+ def test_dhcp4_ and_dhcp6( self): textwrap. dedent( """\ and_read( network_ config= conf) files[' /etc/network/ interfaces' ])
+ conf = yaml.load(
+ version: 1
+ config:
+ - 'type': 'physical'
+ 'name': 'iface0'
+ 'subnets':
+ - {'type': 'dhcp4'}
+ - {'type': 'dhcp6'}
+ """))
+
+ #conf = [
+ # {'type': 'physical', 'name': 'iface0',
+ # 'subnets': [
+ # {'type': 'dhcp4'},
+ # {'type': 'dhcp6'},
+ # ]},
+ #]
+ files = self._render_
+ raise Exception(
+