首页 文章

Mininet路由无法正常工作

提问于
浏览
1

我遇到Mininet拓扑问题 . 我想在 h3h4 之间进行ping操作 . 它们连接到同一个开关 s4 . 但他们不能ping,他们在不同的子网,所以我想做一个 flow table for s4 但没有成功 . 这是我的拓扑图像:

enter image description here

运行Mininet之后我设置了这个:

h3 route add default gw 30.0.0.254 h3-eth0
h3 arp -s 30.0.0.254 00:00:00:00:33:33
h4 route add default gw 40.0.0.254 h4-eth0
h4 arp -s 40.0.0.254 00:00:00:00:44:44

然后我填充 s4 flow table

table=0,ip,nw_src=30.0.0.3,actions=resubmit(,1)
table=0,ip,nw_src=40.0.0.4,actions=resubmit(,1)
table=0,icmp,nw_src=30.0.0.3,actions=resubmit(,1)
table=0,icmp,nw_src=40.0.0.4,actions=resubmit(,1)

table=1,ip,nw_dst=30.0.0.3,actions=mod_dl_dst=00:00:00:00:00:03,output:1
table=1,ip,nw_dst=40.0.0.4,actions=mod_dl_dst=00:00:00:00:00:04,output:2

table=1,priority=0,arp,nw_dst=30.0.0.3,actions=output:1
table=1,priority=0,arp,nw_dst=40.0.0.4,actions=output:2

当我在 h3 and h4 和显示 s4 dump-flow 之间运行ping时,我得到了这个

table=0, n_packets=1, n_bytes=98, idle_age=6, ip,nw_src=30.0.0.3 actions=resubmit(,1)
 table=0, n_packets=0, n_bytes=0, idle_age=17, ip,nw_src=40.0.0.4 actions=resubmit(,1)
 table=0, n_packets=0, n_bytes=0, idle_age=17, icmp,nw_src=30.0.0.3 actions=resubmit(,1)
 table=0, n_packets=0, n_bytes=0, idle_age=17, icmp,nw_src=40.0.0.4 actions=resubmit(,1)
 table=1, n_packets=0, n_bytes=0, idle_age=17, ip,nw_dst=30.0.0.3 actions=mod_dl_dst:00:00:00:00:00:03,output:1
 table=1, n_packets=1, n_bytes=98, idle_age=6, ip,nw_dst=40.0.0.4 actions=mod_dl_dst:00:00:00:00:00:04,output:2
 table=1, n_packets=0, n_bytes=0, idle_age=17, priority=0,arp,arp_tpa=30.0.0.3 actions=output:1
 table=1, n_packets=0, n_bytes=0, idle_age=17, priority=0,arp,arp_tpa=40.0.0.4 actions=output:2

而Mininet只说这个:

mininet> h3 ping h4 -c1
PING 40.0.0.4 (40.0.0.4) 56(84) bytes of data.
^C
--- 40.0.0.4 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

你能帮我解决一下如何 Build 连接吗?或者s4上的流表有什么问题?先感谢您 .

1 回答

  • 0

    安装Wireshark并使用命令 s4 Wireshark 来观察交换机和主机之间的数据包 . 检查数据包的目标mac地址是否已正确更改 .

相关问题