summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--python/vyos/ifconfig/interface.py8
-rwxr-xr-xsrc/conf_mode/container.py2
2 files changed, 9 insertions, 1 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 7dbedea45..634060c4b 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -1549,6 +1549,14 @@ class VLANIf(Interface):
if self.exists(f'{self.ifname}'):
return
+ # If source_interface or vlan_id was not explicitly defined (e.g. when
+ # calling VLANIf('eth0.1').remove() we can define source_interface and
+ # vlan_id here, as it's quiet obvious that it would be eth0 in that case.
+ if 'source_interface' not in self.config:
+ self.config['source_interface'] = '.'.join(self.ifname.split('.')[:-1])
+ if 'vlan_id' not in self.config:
+ self.config['vlan_id'] = self.ifname.split('.')[-1]
+
cmd = 'ip link add link {source_interface} name {ifname} type vlan id {vlan_id}'
if 'protocol' in self.config:
cmd += ' protocol {protocol}'
diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py
index 2d7f03e7f..667d08f8c 100755
--- a/src/conf_mode/container.py
+++ b/src/conf_mode/container.py
@@ -361,7 +361,7 @@ def generate(container):
'name' : network,
'plugins' : [{
'type': 'bridge',
- 'bridge': f'cni-{network}',
+ 'bridge': f'pod-{network}',
'isGateway': True,
'ipMasq': False,
'hairpinMode': False,