I am struggling to forward packets from eth0 to eth1 (and back) on my RPi. I have enabled IP forwarding by adding net.ipv4.ip_forward=1
in /etc/sysctl.conf
, and putting an ip_forward
file containing 1
in /proc/sys/net/ipv4/
. My IP Tables are set to accept all traffic.
The network is as follows:
PC#1(10.0.0.101 /24 gateway 10.0.0.201) hardwired to RPi eth0(10.0.0.201 /24) theoretically routed to RPi eth1(192.168.1.201 /24) and then hardwired to PC#2 (192.168.1.203 /24). PC#1 has his routing table set properly to send anything destined to the 192.168.1.x LAN through his 10.0.0.101 NIC.
If I ping either the eth0 or eth1 NIC from PC#1 I get good answers, but do not get answers from PC#2. If I take a cable directly from PC#1 to PC#2, PC#2 answers the ping which tells me that PC#1's routing tables are OK, and that PC#2 is capable of answering a ping request. Additionally, if I'm sitting at the RPi, I can successfully ping PC#1 and PC#2. This only leaves the routing piece of the RPi as the bad guy. I'm not an expert at Linux and am thinking I'm missing some simple, stupid thing, but I've crawled all over the internet without success. Any help is greatly appreciated.
Doc
iptables
wrong. What you're looking for is masquerading. – PNDA Jan 5 '16 at 0:26PC#1 has his routing table set properly to send anything destined to the 192.168.1.x LAN through his 10.0.0.101 NIC
- does PC#2 routing include 10.0.0.x LAN through 192.168.1.203? – Jaromanda X Jan 5 '16 at 2:48