Linux Mininet路由不工作

Linux Mininet路由不工作,linux,networking,mininet,sdn,Linux,Networking,Mininet,Sdn,我对Mininet拓扑有问题。我正在尝试在h3和h4之间进行ping。它们连接到同一个开关s4。但是它们不能ping,它们在不同的子网中,所以我尝试为s4制作一个流表,但没有成功。 以下是我的拓扑图: 运行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

我对Mininet拓扑有问题。我正在尝试在h3h4之间进行ping。它们连接到同一个开关s4。但是它们不能ping,它们在不同的子网中,所以我尝试为s4制作一个流表,但没有成功。 以下是我的拓扑图:

运行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=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上的流量表有什么问题?提前感谢。

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

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