Skip to content

Instantly share code, notes, and snippets.

@icarocamelo
Created August 19, 2015 19:18
Show Gist options
  • Save icarocamelo/9aaae83ac989751b6275 to your computer and use it in GitHub Desktop.
Save icarocamelo/9aaae83ac989751b6275 to your computer and use it in GitHub Desktop.
#!/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=RemoteController )
net.addController( 'c0' )
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:YOURODLCONTROLLERIPADDRESS:6633')
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