'Mininet: ping doesnt work with two routers

My task is that all host should be able to ping every other hosts. When it has one router jump it works well, but when they have two routers to go over, it gets stuck.

The Topology: enter image description here

r6-s4: 31.0.0.254/8

r6-h5: 41.0.0.254/8

r6-r8: 192.168.113.1/24

r7-s5: 31.0.0.253/8

r7-h6: 51.0.0.254/8

r7-r8: 192.168.121.1/24

r8-r6: 192.168.113.2/24

r8-r7: 192.168.121.2/24

r8-h4: 61.0.0.254/8

Code:

r6 ip addr add 31.0.0.254/8 dev r6-eth0

r6 ip addr add 41.0.0.254/8 dev r6-eth2

r6 ip addr add 192.168.113.1/24 dev r6-eth1

r7 ip addr add 31.0.0.253/8 dev r7-eth0

r7 ip addr add 51.0.0.254/8 dev r7-eth2

r7 ip addr add 192.168.121.1/24 dev r7-eth1

r8 ip addr add 192.168.113.2/24 dev r8-eth0

r8 ip addr add 192.168.121.2/24 dev r8-eth1

r8 ip addr add 61.0.0.254/8 dev r8-eth2

h1 ip route add 31.0.0.254 dev h1-eth0

h1 ip route add default via r6 dev h1-eth0

r6 ip route add 10.0.0.1 dev r6-eth0

h2 ip route add 31.0.0.254 dev h2-eth0

h2 ip route add default via r6 dev h2-eth0

r6 ip route add 10.0.0.2 dev r6-eth0

h3 ip route add 31.0.0.253 dev h3-eth0

h3 ip route add default via r7 dev h3-eth0

r7 ip route add 10.0.0.3 dev r7-eth0

h6 ip route add 51.0.0.254 dev h6-eth0

h6 ip route add default via 51.0.0.254 dev h6-eth0

r7 ip route add 13.0.0.1 dev r7-eth2

h4 ip route add 61.0.0.254 dev h4-eth0

h4 ip route add default via 61.0.0.254 dev h4-eth0

r8 ip route add 11.0.0.1 dev r8-eth2

h5 ip route add 41.0.0.254 dev h5-eth0

h5 ip route add default via 41.0.0.254 dev h5-eth0

r6 ip route add 12.0.0.1 dev r6-eth2



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source