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/env python3 | |
""" | |
Mininet host order sanity test | |
We make sure that net.topo.hosts(sorted=False) | |
returns hosts in the order they were added. | |
We also make sure that net.hosts is in canonical | |
order, which should also be different from repr() |
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 | |
""" | |
OVS Bridge with Spanning Tree Protocol | |
Note: STP bridges don't start forwarding until | |
after STP has converged, which can take a while! | |
See below for a command to wait until STP is up. | |
Example: |
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 | |
""" | |
Example of adding a node prefix to avoid namespace conflicts | |
(and changing the controller port to avoid port conflicts.) | |
If we use UserSwitch, then we can run in a Mininet host (!) | |
""" | |
from mininet.net import Mininet |
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 ) |
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 | |
""" | |
Example to create a Mininet topology and connect it to the internet via NAT | |
through eth0 on the host. | |
Glen Gibb, February 2011 | |
(slight modifications by BL, 5/13) | |
""" |