Created
August 20, 2015 13:46
-
-
Save icarocamelo/9d87ff16002120b00b47 to your computer and use it in GitHub Desktop.
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.node import Controller, RemoteController | |
from mininet.cli import CLI | |
from mininet.log import setLogLevel, info | |
def emptyNet(): | |
net = Mininet(controller=None) | |
net.addController( 'c0', controller=RemoteController, ip='10.0.1.6', port=6653 ) | |
h1 = net.addHost( 'h1' ) | |
h2 = net.addHost( 'h2' ) | |
s1 = net.addSwitch( 's1' ) | |
net.addLink( h1, s1 ) | |
net.addLink( h2, s1 ) | |
net.start() | |
s1.cmd('ovs-vsctl set-controller s1 ssl:10.0.1.6:6653') | |
CLI( net ) | |
net.stop() | |
if __name__ == '__main__': | |
setLogLevel( 'info' ) | |
emptyNet() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment