Skip to content

Commit

Permalink
update ioc_start.py - skip bridge setup if none
Browse files Browse the repository at this point in the history
  • Loading branch information
Defenso-QTH committed Nov 16, 2024
1 parent 32de9d5 commit f1212ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions iocage_lib/ioc_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ def start_network_interface_vnet(
"""
Start VNET on interface
:param nic_defs: comma separated interface definitions (nic, bridge)
:param nic_defs: comma separated interface definitions (nic:bridge, nic:bridge...)
:param net_configs: Tuple of IP address and router pairs
:param jid: The jails ID
"""
Expand All @@ -1167,7 +1167,7 @@ def start_network_interface_vnet(
try:
if self.get(f"{nic}_mtu") != 'auto':
membermtu = self.get(f"{nic}_mtu")
elif not nat_addr:
elif not nat_addr and bridge != 'none':
membermtu = self.find_bridge_mtu(bridge)
else:
membermtu = self.get('vnet_default_mtu')
Expand Down Expand Up @@ -1301,7 +1301,7 @@ def start_network_vnet_iface(self, nic, bridge, mtu, jid, nat_addr=0):
stderr=su.STDOUT
)

if not nat_addr:
if bridge != 'none' and not nat_addr:
try:
# Host interface as supplied by user also needs to be on
# the bridge
Expand All @@ -1319,7 +1319,7 @@ def start_network_vnet_iface(self, nic, bridge, mtu, jid, nat_addr=0):
['ifconfig', bridge, 'addm', f'{nic}.{jid}', 'up'],
stderr=su.STDOUT
)
else:
elif nat_addr:
iocage_lib.ioc_common.checkoutput(
['ifconfig', f'{nic}.{jid}', 'inet', f'{nat_addr}/30'],
stderr=su.STDOUT
Expand Down

0 comments on commit f1212ae

Please sign in to comment.