set IP addresses on TAP devices used with EMANE 0.9.2 (fixes bug #268)
(Boeing r1892)
This commit is contained in:
parent
be4f431ab6
commit
5c9c8bfff7
2 changed files with 7 additions and 2 deletions
|
@ -212,6 +212,7 @@ class EmaneNode(EmaneNet):
|
||||||
for netif in self.netifs():
|
for netif in self.netifs():
|
||||||
if do_netns and "virtual" in netif.transport_type.lower():
|
if do_netns and "virtual" in netif.transport_type.lower():
|
||||||
netif.install()
|
netif.install()
|
||||||
|
netif.setaddrs()
|
||||||
# if we are listening for EMANE events, don't generate them
|
# if we are listening for EMANE events, don't generate them
|
||||||
if self.session.emane.doeventmonitor():
|
if self.session.emane.doeventmonitor():
|
||||||
netif.poshook = None
|
netif.poshook = None
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#
|
#
|
||||||
# CORE
|
# CORE
|
||||||
# Copyright (c)2011-2012 the Boeing Company.
|
# Copyright (c)2011-2014 the Boeing Company.
|
||||||
# See the LICENSE file included in this distribution.
|
# See the LICENSE file included in this distribution.
|
||||||
#
|
#
|
||||||
# authors: Tom Goff <thomas.goff@boeing.com>
|
# authors: Tom Goff <thomas.goff@boeing.com>
|
||||||
|
@ -111,10 +111,14 @@ class TunTap(PyCoreNetIf):
|
||||||
return
|
return
|
||||||
self.node.cmd([IP_BIN, "link", "set", self.localname,
|
self.node.cmd([IP_BIN, "link", "set", self.localname,
|
||||||
"name", self.name])
|
"name", self.name])
|
||||||
|
self.node.cmd([IP_BIN, "link", "set", self.name, "up"])
|
||||||
|
|
||||||
|
def setaddrs(self):
|
||||||
|
''' Set interface addresses based on self.addrlist.
|
||||||
|
'''
|
||||||
for addr in self.addrlist:
|
for addr in self.addrlist:
|
||||||
self.node.cmd([IP_BIN, "addr", "add", str(addr),
|
self.node.cmd([IP_BIN, "addr", "add", str(addr),
|
||||||
"dev", self.name])
|
"dev", self.name])
|
||||||
self.node.cmd([IP_BIN, "link", "set", self.name, "up"])
|
|
||||||
|
|
||||||
class GreTap(PyCoreNetIf):
|
class GreTap(PyCoreNetIf):
|
||||||
''' GRE TAP device for tunneling between emulation servers.
|
''' GRE TAP device for tunneling between emulation servers.
|
||||||
|
|
Loading…
Reference in a new issue