0

im having troubles with raspbian (raspberry's debian) while trying to route two networks. My network configuration is this (/etc/network/interfaces):

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.81.3
        netmask 255.255.255.248
        network 192.168.81.0
        broadcast 192.168.81.7
        gateway 192.168.81.1

iface eth1 inet static
        address 10.0.0.1
        netmask 255.255.255.0
        network 10.0.0.0
        broadcast 10.0.0.255

And this is what route prints:

root@raspberrypi:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.81.1    0.0.0.0         UG    0      0        0 eth0
10.0.0.0        *               255.255.255.0   U     0      0        0 eth1
192.168.81.0    *               255.255.255.248 U     0      0        0 eth0

root@raspberrypi:~# route -C
Kernel IP routing cache
Source          Destination     Gateway         Flags Metric Ref    Use Iface

When I execute "cat /proc/sys/net/ipv4/ip_forward" it returns 1, so I assume ipForwarding is running. But the problem is that it is not forwarding packets between network adapters..

I can ping between devices on the same network, but when I try to contact with hosts on the other network it fails... I don't know what im missing or why is my routing cache empty. Someone knows?

  • How do you know forwarding isn't working? Consider A → Raspbian → B, does A have a route to B's network via Raspbian, and does B have a route to A's network also via Raspbian? – roaima May 20 '15 at 23:16
  • I can ping from A to any host on A network and also to Raspbian (interface on A) But cannot connect from A to raspbians B network adapter. – Akiru May 20 '15 at 23:34
0

Fixed!

I was so much focused on raspbian, thinking that the issue should be there, and found that my internet (gateway) router on 192.168.81.1 wasnt redirecting 10.0.0.0 back to 192.168.81.3 (raspbian). So, I manually added the route in 192.168.81.1 and fixed!

Seems that my raspberry was successfully configured, and I was so blind looking at it that forgot to configure my main gateway (the one who exits to internet).

Thanks @roaima for opening my eyes!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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