Reputation: 1
I want to create a simple topology with 2 hosts (h1,h2) and 2 switches (s1,s2), but i want to connect h1 to s1 and s2 at the same time but i will activate only 1 connection as needed. Like this(where green link is an activate and the red one is deactivate:
You can see here what I'm looking for:
In the beginning h1-s1 is up and h1-s2 is down so h1 and h2 will communicate through s1 and s2. But imagine that is a problem with connection h1-s1. h1 and h2 will continue communicate through s2 because I can activate h1-s2.
This is my code in python to run mininet:
net = Mininet(switch=OVSSwitch,controller=None,autoSetMacs=None)
c1 = RemoteController( 'c1', ip='10.3.3.219', port=6653 )
net.addController(c1)
c2 = RemoteController( 'c2', ip='10.3.3.220', port=6653 )
net.addController(c2)
print('*** Adding hosts')
h1 = net.addHost('h1')
h2 = net.addHost('h2')
print('*** Adding switches')
s1 = net.addSwitch('s1', protocols='OpenFlow13')
s2 = net.addSwitch('s2', protocols='OpenFlow13')
print('*** Adding links')
net.addLink(h1, s1)
net.addLink(s1, s2)
net.addLink(h2, s2)
net.configLinkStatus('h1','s1','down')
net.addLink(h1, s2)
This didn't work. When I deactivate H1 - S1 and activate H1 - S2, H1 can't reach H2.
Upvotes: 0
Views: 256