Mininet Routing not working

2019-08-11 07:08发布

I have a problem with Mininet topology. I am trying to make a ping between h3 and h4. They are connected to same switch s4. But they can not ping, they are in different subnet, so i am trying to make a flow table for s4 but with no success. Here is image of my topology :

enter image description here

after running Mininet I set up this:

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

Then I populate 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

when I run ping between h3 and h4 and display s4 dump-flow I am getting this

 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

and Mininet is saying only this:

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

Could you help me please how to make connectivity? Or what is wrong in flow table on s4? Thank you in advance.

1条回答
Fickle 薄情
2楼-- · 2019-08-11 07:37

Install Wireshark and use the command s4 Wireshark to observe the packets between the switch and the hosts. Check if the destination mac address of the packet has properly changed.

查看更多
登录 后发表回答