Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
505 B
1
Indexable
Never
from mininet.topo import Topo

class CustomTopology(Topo):
    def build(self):
        # Add switches
        switch1 = self.addSwitch('s1')
        switch2 = self.addSwitch('s2')

        # Add hosts
        host1 = self.addHost('h1')
        host2 = self.addHost('h2')

        # Add links
        self.addLink(switch1, host1)
        self.addLink(switch1, host2)
        self.addLink(switch2, host1)
        self.addLink(switch2, host2)
        self.addLink(switch1, switch2)

topo = CustomTopology()
Leave a Comment