blob: 459efb18478ad94b733f9027d501f50a11060bcc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
from common import netns
# up interface. if netns is None, then up in global rt. if ok returns 0
def create(parent_if, vlan, netns_name):
command = (
"ip link add link %s name %s.%d type vlan id %d"
% (parent_if, parent_if, vlan, vlan)
).split()
vlan, out, err = netns.exec(netns_name, command)
print("vlan.create: exit=%d out=%s err=%s" % (vlan, out, err))
return vlan
|