Skip to content

Instantly share code, notes, and snippets.

@imirzadeh
Created June 29, 2017 09:45
Show Gist options
  • Save imirzadeh/27b4fbfdde857b5d7ee522fe4bc48371 to your computer and use it in GitHub Desktop.
Save imirzadeh/27b4fbfdde857b5d7ee522fe4bc48371 to your computer and use it in GitHub Desktop.
topo
from mininet.topo import Topo
class MyTopo( Topo ):
"Simple topology example."
def __init__( self ):
"Create custom topo."
# Initialize topology
Topo.__init__( self )
# Add hosts and switches
h1= self.addHost( 'h1' )
h2 = self.addHost( 'h2' )
h3 = self.addHost( 'h3' )
s1 = self.addSwitch( 's1' )
# Add links
self.addLink(h1, s1)
self.addLink(h2, s1)
self.addLink(h3, s1)
topos = { 'mytopo': ( lambda: MyTopo() ) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment