Created
September 12, 2013 20:38
-
-
Save lantz/6543406 to your computer and use it in GitHub Desktop.
Simple example of adding a host to a Mininet network after calling `net.start()`; should work in Mininet 2.1.0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from mininet.net import Mininet | |
from mininet.topo import SingleSwitchTopo | |
net = Mininet( topo=SingleSwitchTopo( 2 ) ) | |
net.start() | |
net.pingAll() | |
print "*** Attaching new host h3 to s1" | |
h3 = net.addHost( 'h3' ) | |
s1 = net[ 's1' ] | |
link = net.addLink( h3, s1 ) | |
s1.attach( link.intf2 ) | |
h3.configDefault() | |
net.pingAll() | |
net.stop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment