summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/net/eni.py2
-rw-r--r--tests/unittests/test_net.py9
2 files changed, 10 insertions, 1 deletions
diff --git a/cloudinit/net/eni.py b/cloudinit/net/eni.py
index b707146c..bb80ec02 100644
--- a/cloudinit/net/eni.py
+++ b/cloudinit/net/eni.py
@@ -355,7 +355,7 @@ class Renderer(renderer.Renderer):
default_gw = " default gw %s" % route['gateway']
content.append(up + default_gw + or_true)
content.append(down + default_gw + or_true)
- elif route['network'] == '::' and route['netmask'] == 0:
+ elif route['network'] == '::' and route['prefix'] == 0:
# ipv6!
default_gw = " -A inet6 default gw %s" % route['gateway']
content.append(up + default_gw + or_true)
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index a9261ebd..d15cd1f4 100644
--- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py
@@ -597,6 +597,8 @@ iface br0 inet static
# control-alias br0
iface br0 inet6 static
address 2001:1::1/64
+ post-up route add -A inet6 default gw 2001:4800:78ff:1b::1 || true
+ pre-down route del -A inet6 default gw 2001:4800:78ff:1b::1 || true
auto bond0.200
iface bond0.200 inet dhcp
@@ -731,6 +733,9 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true
eth3: 50
eth4: 75
priority: 22
+ routes:
+ - to: ::/0
+ via: 2001:4800:78ff:1b::1
vlans:
bond0.200:
dhcp4: true
@@ -863,6 +868,10 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true
address: 192.168.14.2/24
- type: static
address: 2001:1::1/64 # default to /64
+ routes:
+ - gateway: 2001:4800:78ff:1b::1
+ netmask: '::'
+ network: '::'
# A global nameserver.
- type: nameserver
address: 8.8.8.8