My raspberry pi is connected via Ethernet to my Ubuntu 14.04 machine (192.168.1.0/24 on eth0).
This machine is connected to the Internet through a Fritz Box WLAN Router (192.168.0.0/24 on wlan0).
The network topology diagram:
To have internet access on my raspberry, I've successfully enabled IP forwarding (net.ipv4.ip_forward) on the Ubuntu machine and configured it's eth0 IP 192.168.1.1 as default gateway on the raspberry. On the Fritz Box I registered the subnet by adding a static IP route to 192.168.1.0/24 through the gateway 192.168.0.2 (see http://en.avm.de/nc/service/fritzbox/fritzbox-7390/knowledge-base/publication/show/581_Configuring-a-static-IP-route-in-the-FRITZ-Box/). The Fritz Box runs a DHCP server, but it's configured to give always the same IP to my Ubuntu server.
From the Ubuntu machine and the raspberry I'm able to ping and access everything (Internet, Laptop, Fritz Box). But from the laptop and other devices in the WLAN I'm not able to access the raspberry.
The routing table on the raspberry:
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
The routing table on the Ubuntu machine:
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0 192.168.0.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0 192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
The routing table on the laptop (and other WLAN clients):
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.0.1 0.0.0.0 UG 1024 0 0 wlp2s0 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp2s0 192.168.0.0 0.0.0.0 255.255.255.0 U 303 0 0 wlp2s0
tracepath 192.168.1.2 (the raspberry) from the laptop returns:
1?: [LOCALHOST] pmtu 1500 1: 192.168.0.2 5.174ms 1: 192.168.0.2 4.743ms 2: no reply 3: no reply 4: no reply ^C
ping 192.168.1.1 (the Ubuntu server on eth0) works just fine:
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.72 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=3.72 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=3.54 ms --- 192.168.1.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2004ms rtt min/avg/max/mdev = 2.724/3.329/3.720/0.439 ms
So it actually goes the right way, but it stucks on the Ubuntu machine.
I've already tried configuring NAT rules, but in my opinion they shouldn't be necessary since the iptables are configured to allow everything (a blocking firewall runs already on the Fritz box) and IP forwarding is enabled. I even tried enabling proxy_arp on both interfaces without success.
Furthermore I found the tool
parprouted for bridging wlan0 and eth0, but running it gave me invalid ARP responses (two MAC addresses for the raspberry IP address) - traced with Wireshark.
Why can't I access my raspberry from the WLAN network?