summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-09 21:20:29 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-09 21:20:29 +0200
commit28454f9613f41a1e70b60eec20930c2232e2d9c9 (patch)
tree778fe4df0cffeed7513e33c5cbd0c438b8236fdd /python/vyos/ifconfig
parent9875a21bdb26df19f2faf3e81153dea15e4f9e3c (diff)
parent316483cbe18811c6eaea07d5b790094a5de45abe (diff)
downloadvyos-1x-28454f9613f41a1e70b60eec20930c2232e2d9c9.tar.gz
vyos-1x-28454f9613f41a1e70b60eec20930c2232e2d9c9.zip
Merge branch 'vxlan' of github.com:c-po/vyos-1x into current
* 'vxlan' of github.com:c-po/vyos-1x: vxlan: pseudo-ethernet: T2260: convert link nodes to source-interface wireguard: T2206: fix comment in migration script pppoe: enable Jinja2 trim_blocks
Diffstat (limited to 'python/vyos/ifconfig')
-rw-r--r--python/vyos/ifconfig/macvlan.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/python/vyos/ifconfig/macvlan.py b/python/vyos/ifconfig/macvlan.py
index 4e4b563a1..55b1a3e91 100644
--- a/python/vyos/ifconfig/macvlan.py
+++ b/python/vyos/ifconfig/macvlan.py
@@ -35,10 +35,10 @@ class MACVLANIf(Interface):
'prefixes': ['peth', ],
},
}
- options = Interface.options + ['link', 'mode']
+ options = Interface.options + ['source_interface', 'mode']
def _create(self):
- cmd = 'ip link add {ifname} link {link} type macvlan mode {mode}'.format(
+ cmd = 'ip link add {ifname} link {source_interface} type macvlan mode {mode}'.format(
**self.config)
self._cmd(cmd)
@@ -54,7 +54,7 @@ class MACVLANIf(Interface):
"""
config = {
'address': '',
- 'link': 0,
+ 'source_interface': '',
'mode': ''
}
return config
@@ -62,7 +62,6 @@ class MACVLANIf(Interface):
def set_mode(self, mode):
"""
"""
-
- cmd = 'ip link set dev {} type macvlan mode {}'.format(
- self.config['ifname'], mode)
+ ifname = self.config['ifname']
+ cmd = f'ip link set dev {ifname} type macvlan mode {mode}'
return self._cmd(cmd)