Commit 79e239d7 authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

update topo make all controllers type is remote.

parent cd5db479
This diff is collapsed.
...@@ -19,48 +19,50 @@ def myNetwork(): ...@@ -19,48 +19,50 @@ def myNetwork():
ipBase='172.16.0.0/16') ipBase='172.16.0.0/16')
info( '*** Adding controller\n' ) info( '*** Adding controller\n' )
c0=net.addController(name='c0',
controller=RemoteController,
ip='127.0.0.1',
protocol='tcp',
port=6633)
c1=net.addController(name='c1', c1=net.addController(name='c1',
controller=Controller, controller=RemoteController,
ip='127.0.0.1',
protocol='tcp', protocol='tcp',
port=6634) port=6634)
c2=net.addController(name='c2', c2=net.addController(name='c2',
controller=Controller,
protocol='tcp',
port=6635)
c0=net.addController(name='c0',
controller=RemoteController, controller=RemoteController,
ip='127.0.0.1', ip='127.0.0.1',
protocol='tcp', protocol='tcp',
port=6633) port=6635)
info( '*** Add switches\n') info( '*** Add switches\n')
s10 = net.addSwitch('s10', cls=OVSKernelSwitch, failMode='standalone')
s9 = net.addSwitch('s9', cls=OVSKernelSwitch, failMode='standalone')
s11 = net.addSwitch('s11', cls=OVSKernelSwitch, failMode='standalone')
s4 = net.addSwitch('s4', cls=OVSKernelSwitch, dpid='4') s4 = net.addSwitch('s4', cls=OVSKernelSwitch, dpid='4')
s3 = net.addSwitch('s3', cls=OVSKernelSwitch, dpid='3')
s7 = net.addSwitch('s7', cls=OVSKernelSwitch, dpid='7')
s8 = net.addSwitch('s8', cls=OVSKernelSwitch, dpid='8')
s1 = net.addSwitch('s1', cls=OVSKernelSwitch, dpid='1') s1 = net.addSwitch('s1', cls=OVSKernelSwitch, dpid='1')
s10 = net.addSwitch('s10', cls=OVSKernelSwitch, failMode='standalone')
s2 = net.addSwitch('s2', cls=OVSKernelSwitch, dpid='2') s2 = net.addSwitch('s2', cls=OVSKernelSwitch, dpid='2')
s9 = net.addSwitch('s9', cls=OVSKernelSwitch, failMode='standalone')
s8 = net.addSwitch('s8', cls=OVSKernelSwitch, dpid='8')
s3 = net.addSwitch('s3', cls=OVSKernelSwitch, dpid='3')
s5 = net.addSwitch('s5', cls=OVSKernelSwitch, dpid='5') s5 = net.addSwitch('s5', cls=OVSKernelSwitch, dpid='5')
s11 = net.addSwitch('s11', cls=OVSKernelSwitch, failMode='standalone')
s7 = net.addSwitch('s7', cls=OVSKernelSwitch, dpid='7')
info( '*** Add hosts\n') info( '*** Add hosts\n')
h10 = net.addHost('h10', cls=Host, ip='172.16.0.10', defaultRoute='via 172.16.0.249')
h6 = net.addHost('h6', cls=Host, ip='172.16.0.6', defaultRoute='via 172.16.0.251')
h12 = net.addHost('h12', cls=Host, ip='172.16.0.12', defaultRoute='via 172.16.0.248')
h1 = net.addHost('h1', cls=Host, ip='172.16.0.1', defaultRoute='via 172.16.0.254')
h11 = net.addHost('h11', cls=Host, ip='172.16.0.11', defaultRoute='via 172.16.0.248')
h13 = net.addHost('h13', cls=Host, ip='172.16.0.13', defaultRoute='via 172.16.0.248')
a1 = net.addHost('a1', cls=Host, ip='172.16.0.5', defaultRoute='via 172.16.0.252') a1 = net.addHost('a1', cls=Host, ip='172.16.0.5', defaultRoute='via 172.16.0.252')
h1 = net.addHost('h1', cls=Host, ip='172.16.0.1', defaultRoute='via 172.16.0.254')
a2 = net.addHost('a2', cls=Host, ip='172.16.0.9', defaultRoute='via 172.16.0.250')
h7 = net.addHost('h7', cls=Host, ip='172.16.0.7', defaultRoute='via 172.16.0.250') h7 = net.addHost('h7', cls=Host, ip='172.16.0.7', defaultRoute='via 172.16.0.250')
h4 = net.addHost('h4', cls=Host, ip='172.16.0.4', defaultRoute='via 172.16.0.252')
h10 = net.addHost('h10', cls=Host, ip='172.16.0.10', defaultRoute='via 172.16.0.249')
h2 = net.addHost('h2', cls=Host, ip='172.16.0.2', defaultRoute='via 172.16.0.253') h2 = net.addHost('h2', cls=Host, ip='172.16.0.2', defaultRoute='via 172.16.0.253')
h11 = net.addHost('h11', cls=Host, ip='172.16.0.11', defaultRoute='via 172.16.0.248')
h6 = net.addHost('h6', cls=Host, ip='172.16.0.6', defaultRoute='via 172.16.0.251')
h8 = net.addHost('h8', cls=Host, ip='172.16.0.8', defaultRoute='via 172.16.0.250') h8 = net.addHost('h8', cls=Host, ip='172.16.0.8', defaultRoute='via 172.16.0.250')
h13 = net.addHost('h13', cls=Host, ip='172.16.0.13', defaultRoute='via 172.16.0.248')
h12 = net.addHost('h12', cls=Host, ip='172.16.0.12', defaultRoute='via 172.16.0.248')
h3 = net.addHost('h3', cls=Host, ip='172.16.0.3', defaultRoute='via 172.16.0.252') h3 = net.addHost('h3', cls=Host, ip='172.16.0.3', defaultRoute='via 172.16.0.252')
h4 = net.addHost('h4', cls=Host, ip='172.16.0.4', defaultRoute='via 172.16.0.252')
a2 = net.addHost('a2', cls=Host, ip='172.16.0.9', defaultRoute='via 172.16.0.250')
info( '*** Add links\n') info( '*** Add links\n')
net.addLink(h2, s4) net.addLink(h2, s4)
...@@ -93,25 +95,25 @@ def myNetwork(): ...@@ -93,25 +95,25 @@ def myNetwork():
controller.start() controller.start()
info( '*** Starting switches\n') info( '*** Starting switches\n')
net.get('s10').start([])
net.get('s9').start([])
net.get('s11').start([])
net.get('s4').start([c1]) net.get('s4').start([c1])
net.get('s3').start([c2])
net.get('s7').start([c0])
net.get('s8').start([c2])
net.get('s1').start([c1]) net.get('s1').start([c1])
net.get('s10').start([])
net.get('s2').start([c0]) net.get('s2').start([c0])
net.get('s9').start([])
net.get('s8').start([c2])
net.get('s3').start([c2])
net.get('s5').start([c1]) net.get('s5').start([c1])
net.get('s11').start([])
net.get('s7').start([c0])
info( '*** Post configure switches and hosts\n') info( '*** Post configure switches and hosts\n')
s4.cmd('ifconfig s4 172.16.0.253') s4.cmd('ifconfig s4 172.16.0.253')
s3.cmd('ifconfig s3 172.16.0.249')
s7.cmd('ifconfig s7 172.16.0.250')
s8.cmd('ifconfig s8 172.16.0.248')
s1.cmd('ifconfig s1 172.16.0.254') s1.cmd('ifconfig s1 172.16.0.254')
s2.cmd('ifconfig s2 172.16.0.251') s2.cmd('ifconfig s2 172.16.0.251')
s8.cmd('ifconfig s8 172.16.0.248')
s3.cmd('ifconfig s3 172.16.0.249')
s5.cmd('ifconfig s5 172.16.0.252') s5.cmd('ifconfig s5 172.16.0.252')
s7.cmd('ifconfig s7 172.16.0.250')
CLI(net) CLI(net)
net.stop() net.stop()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment