Skip to content
Snippets Groups Projects
Commit 1a9d2eac authored by Bob Lantz's avatar Bob Lantz
Browse files

Fixed createLink args and cleaned up slightly.

parent 73a323f2
No related branches found
No related tags found
No related merge requests found
...@@ -37,12 +37,10 @@ def connectToRootNS( network, switch, ip, prefixLen, routes ): ...@@ -37,12 +37,10 @@ def connectToRootNS( network, switch, ip, prefixLen, routes ):
routes: host networks to route to""" routes: host networks to route to"""
# Create a node in root namespace and link to switch 0 # Create a node in root namespace and link to switch 0
root = Node( 'root', inNamespace=False ) root = Node( 'root', inNamespace=False )
port = max( switch.ports.values() ) + 1 intf = createLink( root, switch )[ 0 ]
createLink( root, 0, switch, port ) root.setIP( intf, ip, prefixLen )
root.setIP( root.intfs[ 0 ], ip, prefixLen )
# Start network that now includes link to root namespace # Start network that now includes link to root namespace
network.start() network.start()
intf = root.intfs[ 0 ]
# Add routes from root ns to hosts # Add routes from root ns to hosts
for route in routes: for route in routes:
root.cmd( 'route add -net ' + route + ' dev ' + intf ) root.cmd( 'route add -net ' + route + ' dev ' + intf )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment