Mininet 路由不工作

Mininet Routing not working

我对 Mininet 拓扑有疑问。我正在尝试在 h3h4 之间进行 ping。它们连接到同一个开关 s4。但他们无法 ping,他们在不同的子网中,所以我试图为 s4 创建一个 flow table 但没有成功。 这是我的拓扑图:

在 运行ning 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流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 和 h4 之间 ping 并显示 s4 转储流 我得到这个

 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

你能帮我看看如何建立连接吗?或者 s4 上的流程 table 有什么问题?提前谢谢你。

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