Everyone, okay? My case is this, I have the following network topology mounted on GNS3.

topology GNS3

I also have the following settings at each point. The configuration below is related to the same topology, but previously it was using ubuntu machines in place of the routers present in the image. In this topology of the image is OpenWRT15.05. The idea is to send a ping from A to B, but when entering R1, the signal should go to R2, then R3, go back to R1 and continue with this sequence, creating a loop. With all this configuration I only managed that the signal arrives at R2, from then on it is lost and I can not get it to continue in the network, passing by R3 and returning to R1 to continue in the loop. If you can help me or give you ideas tips that can help me, I'll be thankful. The present doubt is for a college work in the matter of networks.

Settings:

topology

A: 0 => R1: 0 (A = host, 0 = interface, => connected)

A: eth0.10 => R1: eht0.10 NET = 10.0.0.0 R1: eth1.12 => R2: eth1.12 NET = 192.168.12.0 B: eth0.20 => R2: eth0.20 NET = 172.16.0.0 R2: eht2.23 => R3: eth1.23 NET = 192.168.23.0 R3: eth0.13 => R1: eth2.13 NET = 192.168.13.0 Configuring A

vconfig add eth0 10
ifconfig eth0.10 up
ifconfig eth0.10 10.0.0.1 netmask 255.255.255.0
route add default gw 10.0.0.2 dev eth0.10

B

vconfig add eth0 20
ifconfig eth0.20 up
ifconfig eth0.20 172.16.0.2 netmask 255.255.255.0
route add default gw 172.16.0.2 dev eth0.20

R1

ifconfig eth2 up
vconfig add eth0 10
ifconfig eth0.10 up
vconfig add eth1 12
ifconfig eth1.12 up
vconfig add eth2 13
ifconfig eth2.13 up

ifconfig eth0.10 10.0.0.2 netmask 255.255.255.0
ifconfig eth1.12 192.168.12.1 netmask 255.255.255.0
ifconfig eth2.13 192.168.13.1 netmask 255.255.255.0


route add default gw 192.168.12.2 dev eth1.12
echo 1 > /proc/sys/net/ipv4/ip_forward

R2

ifconfig eth2 up
vconfig add eth0 20
ifconfig eth0.20 up
vconfig add eth1 12
ifconfig eth1.12 up
vconfig add eth2 23
ifconfig eth2.23 up

ifconfig eth0.20 172.16.0.1 netmask 255.255.255.0
ifconfig eth1.12 192.168.12.2 netmask 255.255.255.0
ifconfig eth2.23 192.168.23.1 netmask 255.255.255.0

route add default gw 192.168.23.2 dev eth2.23
echo 1 > /proc/sys/net/ipv4/ip_forward

R3

vconfig add eth0 13
ifconfig eth0.13 up
vconfig add eth1 23
ifconfig eth1.23 up

ifconfig eth0.13 192.168.13.2 netmask 255.255.255.0
ifconfig eth1.23 192.168.23.2 netmask 255.255.255.0

route add default gw 192.168.13.2 dev eth0.13
echo 1 > /proc/sys/net/ipv4/ip_forward

*/etc/networks/interfaces

A

nano /etc/network/interfaces

iface eth0:10 inet static
    adress 10.0.0.1
    netmask 255.255.255.0
    broadcast 10.0.0.255
    network 10.0.0.0
    gateway 10.0.0.2

B

nano /etc/network/interfaces

iface eth0:20 inet static
    adress 172.16.0.2
    netmask 255.255.255.0
    broadcast 172.16.0.255
    network 172.16.0.0
    gateway 172.16.0.1

R1

iface eth0:10 inet static
    adress 10.0.0.2
    netmask 255.255.255.0
    broadcast 10.0.0.255
    network 10.0.0.0
    gateway 192.168.12.1

iface eth1:12 inet static
    adress 192.168.12.1
    netmask 255.255.255.0
    broadcast 192.168.12.255
    network 192.168.12.0
    gateway 192.168.12.2

iface eth2:13 inet static
    adress 192.168.13.1
    netmask 255.255.255.0
    broadcast 192.168.13.255
    network 192.168.13.0
    gateway 192.168.12.1

R2

iface eth0:20 inet static
    adress 172.16.0.1
    netmask 255.255.255.0
    broadcast 172.16.0.255
    network 172.16.0.0
    gateway 192.168.12.2

iface eth1:12 inet static
    adress 192.168.12.2
    netmask 255.255.255.0
    broadcast 192.168.12.255
    network 192.168.12.0
    gateway 192.168.23.1

iface eth2:23 inet static
    adress 192.168.23.1
    netmask 255.255.255.0
    broadcast 192.168.23.255
    network 192.168.23.0
    gateway 192.168.12.2
  • 1
    I have not studied your post in depth, but I do note you have not disabled reverse path filtering, and posit that that is your stumbling block. Google rp_filter - this is controlled in much the same way as ip_forward – davidgo Oct 2 '17 at 1:17
up vote 4 down vote accepted

There are several issues here.

I don't know if these are typos or what.

First, you show the computer B config and you show you are configuring a default gateway of 172.16.0.2, but later in the interfaces config you show 172.16.0.1. The latter is correct, the former is not.

Second, in the Router 3 configuration you show a default gateway of 192.168.13.2 which is the same address as one of the interfaces on Router 3. Instead it should be 192.168.13.1 which is the Router 1 interface.

Third, you need to remove the gateway setting from the router interfaces. They are wrong. You can't have a gateway IP address configured on an interface that isn't on the same subnet as the interface's own IP address. That is the whole point of a gateway - it is a route on the same subnet that has a way OUT of the subnet. Routers don't use, and shouldn't have gateways configured on the interfaces. Instead the default gateway is the only thing important on this setup.

Fourth, you aren't going to create a loop by pinging B from A even if it was configured correctly. Router 2 sees the IP address of computer B as being directly connected. Therefore, it will NOT use the default gateway. Instead it will send the packet directly to computer B. Therefore, your ping from A to B will pass through properly, without a loop.

If you want to create a loop you have to ping an IP address that is not part of any network in your topology. You can do that from Computer A or B. For instance, ping 10.91.13.5.

If you want to confirm you are looping, you'll get a TTL Expired in transit from one of the routers. If you change the TTL on your ping you will be able to get a TTL expired in transit from any of the 3 routers.

With that said, you do understand the packet will not loop indefinitely right? That is what the TTL is for.

As it stands, your ping from A is making it to B but there is no valid return path back for the reply.

Keep up the studying and the good work!

  • Thank you, you helped me a lot to understand some things that were still misunderstood. Thank you very much. – Neto Miranda Oct 2 '17 at 23:24

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.