Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
We now no longer rename interfaces in the jail
Browse files Browse the repository at this point in the history
Some tools (Plex) filter interfaces starting with v assuming they are all VMWare interfaces. Let's stick to FreeBSD convention for our interface naming inside the jail.

Closes #470
  • Loading branch information
Brandon Schneider committed Jan 18, 2018
1 parent b9ba150 commit a941b75
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions iocage/lib/ioc_start.py
Expand Up @@ -487,14 +487,21 @@ def start_network_interface_vnet(self, nic_defs, net_configs, jid):
continue

for addr in addrs.split(','):
iface, ip = addr.split("|")
try:
iface, ip = addr.split("|")
except ValueError:
# vnet0 is now for legacy compat as we don't rename
# the interface inside the jail.

iface, ip = "vnet0", addr

if iface not in nics:
continue

if iface not in ifaces:
self.start_network_vnet_iface(nic, bridge,
membermtu, jid)
iface = self.start_network_vnet_iface(nic, bridge,
membermtu,
jid)

ifaces.append(iface)

Expand Down Expand Up @@ -540,12 +547,11 @@ def start_network_vnet_iface(self, nic, bridge, mtu, jid):
stderr=su.STDOUT)
iocage.lib.ioc_common.checkoutput(
["setfib", self.exec_fib, "jexec", f"ioc-{self.uuid}",
"ifconfig", epair_b, "name", nic, "mtu", mtu],
stderr=su.STDOUT)
"ifconfig", epair_b, "mtu", mtu], stderr=su.STDOUT)
iocage.lib.ioc_common.checkoutput(
["setfib", self.exec_fib, "jexec", f"ioc-{self.uuid}",

"ifconfig", nic, "link", mac_b], stderr=su.STDOUT)
"ifconfig", epair_b, "link", mac_b], stderr=su.STDOUT)
iocage.lib.ioc_common.checkoutput(
["ifconfig", bridge, "addm", f"{nic}:{jid}", "up"],
stderr=su.STDOUT)
Expand All @@ -555,7 +561,7 @@ def start_network_vnet_iface(self, nic, bridge, mtu, jid):
except su.CalledProcessError as err:
return f"{err.output.decode('utf-8')}".rstrip()
else:
return
return epair_b

def start_network_vnet_addr(self, iface, ip, defaultgw, ipv6=False):
"""
Expand Down

0 comments on commit a941b75

Please sign in to comment.