fix bug #253 "NetworkManager runs DHCP..." for Ubuntu (but not Fedora/CentOS)

use "vethA.B.SS" name for veth devices (A = node number, B = index, SS = short session ID)
use "tapA.B.SS" name for tap devices; use "b.A.SS" name for bridge devices
added a SESSION_SHORT environment variable to the default CORE environment
(Boeing r1867)
This commit is contained in:
ahrenholz 2014-08-04 17:28:35 +00:00
parent 4487767fa4
commit 66ebcb5cf4
5 changed files with 9 additions and 6 deletions

View file

@ -17,7 +17,8 @@
- support link delays up to 274 seconds (netem maximum) - support link delays up to 274 seconds (netem maximum)
- allow runtime changes of WLAN link effects - allow runtime changes of WLAN link effects
* DAEMON: * DAEMON:
- set NODE_NAME and NODE_NUMBER in default vnoded environment - set NODE_NAME, NODE_NUMBER, SESSION_SHORT in default vnoded environment
- changed host device naming to use veth, tap prefixes; b.n.SS for bridges
- allow parsing XML files into live running session - allow parsing XML files into live running session
- enable link effects between hub/switch and hub/switch connections - enable link effects between hub/switch and hub/switch connections
- update MDR service to use broadcast interfaces for non-WLAN links - update MDR service to use broadcast interfaces for non-WLAN links

View file

@ -211,7 +211,8 @@ class LxBrNet(PyCoreNet):
if policy is not None: if policy is not None:
self.policy = policy self.policy = policy
self.name = name self.name = name
self.brname = "b.%s.%s" % (str(self.objid), self.session.sessionid) sessionid = self.session.shortsessionid()
self.brname = "b.%s.%s" % (str(self.objid), sessionid)
self.up = False self.up = False
if start: if start:
self.startup() self.startup()

View file

@ -167,8 +167,8 @@ class SimpleLxcNode(PyCoreNode):
if ifname is None: if ifname is None:
ifname = "eth%d" % ifindex ifname = "eth%d" % ifindex
sessionid = self.session.shortsessionid() sessionid = self.session.shortsessionid()
name = "n%s.%s.%s" % (self.objid, ifindex, sessionid) name = "veth%s.%s.1.%s" % (self.objid, ifindex, sessionid)
localname = "n%s.%s.%s" % (self.objid, ifname, sessionid) localname = "veth%s.%s.%s" % (self.objid, ifindex, sessionid)
if len(ifname) > 16: if len(ifname) > 16:
raise ValueError, "interface local name '%s' to long" % \ raise ValueError, "interface local name '%s' to long" % \
localname localname
@ -198,7 +198,7 @@ class SimpleLxcNode(PyCoreNode):
if ifname is None: if ifname is None:
ifname = "eth%d" % ifindex ifname = "eth%d" % ifindex
sessionid = self.session.shortsessionid() sessionid = self.session.shortsessionid()
localname = "n%s.%s.%s" % (self.objid, ifindex, sessionid) localname = "tap%s.%s.%s" % (self.objid, ifindex, sessionid)
name = ifname name = ifname
ifclass = TunTap ifclass = TunTap
tuntap = ifclass(node = self, name = name, localname = localname, tuntap = ifclass(node = self, name = name, localname = localname,

View file

@ -321,6 +321,7 @@ class Session(object):
''' '''
env = os.environ.copy() env = os.environ.copy()
env['SESSION'] = "%s" % self.sessionid env['SESSION'] = "%s" % self.sessionid
env['SESSION_SHORT'] = "%s" % self.shortsessionid()
env['SESSION_DIR'] = "%s" % self.sessiondir env['SESSION_DIR'] = "%s" % self.sessiondir
env['SESSION_NAME'] = "%s" % self.name env['SESSION_NAME'] = "%s" % self.name
env['SESSION_FILENAME'] = "%s" % self.filename env['SESSION_FILENAME'] = "%s" % self.filename

View file

@ -45,7 +45,7 @@ killall -q emanetransportd
killall -q emaneeventservice killall -q emaneeventservice
ifconfig -a | awk ' ifconfig -a | awk '
/^n[0-9]+/ {print "removing interface " $1; system("ip link del " $1);} /^veth[0-9]+\./ {print "removing interface " $1; system("ip link del " $1);}
/tmp\./ {print "removing interface " $1; system("ip link del " $1);} /tmp\./ {print "removing interface " $1; system("ip link del " $1);}
/gt\./ {print "removing interface " $1; system("ip link del " $1);} /gt\./ {print "removing interface " $1; system("ip link del " $1);}
/b\./ {print "removing bridge " $1; system("ip link set " $1 " down; brctl delbr " $1);} /b\./ {print "removing bridge " $1; system("ip link set " $1 " down; brctl delbr " $1);}