mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
addons: link: use iproute2 to create custom devices (fixes #156)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
@@ -100,7 +100,7 @@ class link(Addon, moduleBase):
|
||||
self.iproute2.link_add_veth(ifaceobj.name, peer_name)
|
||||
|
||||
elif link_type:
|
||||
self.netlink.link_add(ifname=ifaceobj.name, kind=link_type)
|
||||
self.iproute2.link_add(ifaceobj.name, link_type)
|
||||
|
||||
def _down(self, ifaceobj):
|
||||
if not ifaceobj.get_attr_value_first('link-type'):
|
||||
|
@@ -254,6 +254,14 @@ class IPRoute2(Cache, Requirements):
|
||||
|
||||
###
|
||||
|
||||
def link_add(self, ifname, link_type):
|
||||
utils.exec_command(
|
||||
"%s link add %s type %s"
|
||||
% (utils.ip_cmd, ifname, link_type)
|
||||
)
|
||||
|
||||
###
|
||||
|
||||
def link_add_macvlan(self, ifname, macvlan_ifname, macvlan_mode):
|
||||
utils.exec_command(
|
||||
"%s link add link %s name %s type macvlan mode %s"
|
||||
|
Reference in New Issue
Block a user