Merge "Add support for bonded interfaces with a static IP."

This commit is contained in:
Jenkins 2016-06-29 16:32:45 +00:00 committed by Gerrit Code Review
commit 9a68df0df5
9 changed files with 69 additions and 0 deletions

View File

@ -427,6 +427,20 @@ def write_debian_interfaces(interfaces, sys_interfaces):
name=interface_name, link_type=link_type)
if vlan_raw_device:
result += " vlan-raw-device {0}\n".format(vlan_raw_device)
if 'bond_master' in interface:
result += " bond-master {0}\n".format(
interface['bond_master'])
if 'bond_mode' in interface:
if interface['mac_address']:
result += " hwaddress {0}\n".format(
interface['mac_address'])
result += " bond-mode {0}\n".format(interface['bond_mode'])
result += " bond-miimon {0}\n".format(
interface['bond_miimon'])
slave_devices = [sys_interfaces[mac]
for mac in interface['raw_macs']]
slaves = ' '.join(slave_devices)
result += " bond-slaves {0}\n".format(slaves)
result += " address {0}\n".format(interface['ip_address'])
result += " netmask {0}\n".format(interface['netmask'])
for route in interface['routes']:

View File

@ -89,6 +89,21 @@
"type": "ipv4_dhcp",
"link": "vlan2",
"id": "network7"
},
{
"network_id": "88888888-8888-8888-8888-888888888888",
"type": "ipv4",
"link": "bond2",
"netmask": "255.255.255.0",
"routes": [
{
"netmask": "0.0.0.0",
"network": "0.0.0.0",
"gateway": "192.0.2.1"
}
],
"ip_address": "192.0.2.2",
"id": "network8"
}
],
"links": [
@ -137,6 +152,18 @@
"type": "phy",
"id": "tap234ab34c-f8"
},
{
"ethernet_mac_address": "BC:76:4E:05:7B:17",
"mtu": 1500,
"type": "phy",
"id": "tap234ab34c-f9"
},
{
"ethernet_mac_address": "BC:76:4E:05:7B:18",
"mtu": 1500,
"type": "phy",
"id": "tap234ab34c-fa"
},
{
"ethernet_mac_address": "BC:76:4E:12:a4:bb",
"mtu": 1500,
@ -188,6 +215,18 @@
"tap234ab34c-f8"
]
},
{
"id": "bond2",
"type": "bond",
"ethernet_mac_address": "BC:76:4E:05:7B:17",
"bond_mode": "802.3ad",
"bond_miimon": 100,
"bond_xmit_hash_policy": "layer3+4",
"bond_links": [
"tap234ab34c-f9",
"tap234ab34c-fa"
]
},
{
"id": "vlan2",
"type": "vlan",

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
bc:76:4e:05:7b:18

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
bc:76:4e:05:7b:17

View File

@ -0,0 +1 @@
1

View File

@ -65,6 +65,16 @@ auto bond1.27
iface bond1.27 inet dhcp
vlan-raw-device bond1
hw-mac-address bc:76:4e:12:a4:be
### Write /etc/network/interfaces.d/bond2.cfg
auto bond2
iface bond2 inet static
hwaddress bc:76:4e:05:7b:17
bond-mode 802.3ad
bond-miimon 100
bond-slaves eth9 eth10
address 192.0.2.2
netmask 255.255.255.0
gateway 192.0.2.1
### Write /etc/resolv.conf
nameserver 72.3.128.241
nameserver 72.3.128.240