1

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?

4
  • Have you set the default gateway correctly on your hosts?
    – Ron Trunk
    Commented May 20, 2015 at 23:31
  • Yep, I have set 10.0.0.1 as gateway on hosts connected to eth1. But when I ping 192.168.81.3 from a host in 10.0.0.0 network it fails
    – Akiru
    Commented May 20, 2015 at 23:37
  • Sadly, this is off-topic. Please post on Super User Commented May 21, 2015 at 1:02
  • 81.3 doesn't know how to get back to 10??? packets flow in both directions.
    – Ricky
    Commented May 21, 2015 at 6:47

1 Answer 1

2

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 succesfully configured, and I was so blind looking at it that forgot to configure my main gateway (the one who exits to internet).

Im feeling so damn dumb now for that noob fail... T_T

1
  • 1
    Next time run tcpdump on the Raspberry Pi to see where the packets are going, maybe that would have helped :)
    – Baldrick
    Commented May 22, 2015 at 10:17

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