I am trying to configure my Debian machine to simply forward all ingoing network packets on interface eth0 to eth1. My hardware setup is the following:
Sender Machine A (eth0) ----> (eth0) Forward Machine B (eth1) ----> (eth0) Receiver Machine C
Machine A simply generates different kinds of network packets (UDP, TCP, ICMP) using a raw socket and sends them over interface eth0, which is directly connected to the eth0 interface of Machine B.
Now, I want Machine B to simply forward each incoming packet, which it receives on eth0, to eth1, regardless of destination IP address, so that Machine C will finally receive those packets on its interface eth0. The reason why I want to do this is an experiment in university.
However, although the default gateway on Machine B is set to the IP of Machine C, packets are not forwarded. Interestingly, a direct ping from Machine A to Machine C works (routes are set up correctly). Also, /proc/sys/net/ipv4/ip_forward is set to 1, and interface eth0 (the "receiving" interface on Machine B, is set to promiscuous mode, so that destination MAC addresses should not be a problem.
Does anybody have an idea, why this does not work? Interestingly, if Machine B runs FreeBSD instead of Debian, it works just fine ...
- Machine B is a Raspberry Pi 2, with the second interface being a USB Ethernet adapter
- All sent packets are IPv4
Thank you very much in advance!