问题描述
我正在尝试使用Mininet和RYU控制器在Linux VM上建立SDN网络。 我想在不同的主机上使用3个单独的VM。 在每个VM上,我都希望有一个ovsk开关和一个主机。 仅有一个RYU控制器可以控制所有3个开关。
VM1: c0,s1,h1
VM2: s2,h2
VM3: s3,h3
我尝试创建水龙头并将其与GRE隧道连接。当只有两个虚拟机时,一切工作正常,但是当我添加第三台机器时,控制器陷入混乱,并且生成了许多ARP请求数据包,并且连接断开。这是我在VM1上所做的事情(我在其他VM上也做过,但更改了地址):
#!/usr/bin/python
from mininet.net import Mininet
from mininet.node import Controller,RemoteController,OVSKernelSwitch
from mininet.cli import CLI
from mininet.log import setLogLevel
from mininet.link import TCLink,Intf
def topology():
"Create a network."
net = Mininet( controller=Controller,link=TCLink,switch=OVSKernelSwitch )
print "*** Creating nodes"
s1 = net.addSwitch('s1')
h1 = net.addHost('h1',ip="10.0.0.1")
c0 = net.addController('c0',controller=RemoteController,ip='172.16.12.7',port=6653)
print "*** Adding Link"
net.addLink(h1,s1)
print "*** Starting network"
c0.start()
s1.start( [c0] )
#GRE tunnels
s1.cmd("ip link add s1-gre2 type gretap local 172.16.12.1 remote 172.16.12.2 ttl 64")
s1.cmd("ip link set s1-gre2 up")
Intf("s1-gre2",node=s1)
s1.cmd("ip link add s1-gre3 type gretap local 172.16.13.1 remote 172.16.13.3 ttl 64")
s1.cmd("ip link set s1-gre3 up")
Intf("s1-gre3",node=s1)
print "*** Running CLI"
net.start()
CLI( net )
print "*** Stopping network"
s1.cmd("ip link del dev s1-gre2")
s1.cmd("ip link del dev s1-gre3")
net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
topology()
非常感谢您的帮助。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)