Skip to content

Commit

Permalink
Configuring static mac address for the bond interface with the
Browse files Browse the repository at this point in the history
first member interface mac address
Closes-Bug: 1454420

Change-Id: I3102ce3edec6ef698ee3a1f2c5dba7f3dfe257d5
  • Loading branch information
cijohnson committed Jun 19, 2015
1 parent 64914eb commit 65f2a0f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contrail_provisioning/common/interface_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,17 +440,21 @@ def create_bonding_interface(self):
'''Create interface config for bond master'''
self.get_mac_from_bond_intf()
self.create_bond_members()
log.info('Creating bond master: %s' %self.device)
bond_mac = self.get_mac_addr(self.members[0])
log.info('Creating bond master: %s with Mac Addr: %s' %
(self.device, bond_mac))
if not self.vlan:
cfg = ['auto %s' %self.device,
'iface %s inet static' %self.device,
'address %s' %self.ipaddr,
'netmask %s' %self.netmask]
'netmask %s' %self.netmask,
'hwaddress %s' % bond_mac]
if self.gw:
cfg.append('gateway %s' %self.gw)
else:
cfg = ['auto %s' %self.device,
'iface %s inet manual' %self.device,
'hwaddress %s' % bond_mac,
'down ip addr flush dev %s' %self.device]
cfg += self.bond_opts_str.split("\n")
self.write_network_script(self.device, cfg)
Expand Down

0 comments on commit 65f2a0f

Please sign in to comment.