There are plenty of examples on here of how to forward ip traffic on a linux machine, and a few examples of how to forward traffic from one interface to another. However, most of the latter examples concern themselves with connecting one machine to the internet - I have an FPGA connected to a windows machine with a Redhat box as an intermediary.
The FPGA spits out data into eth 0 of the redhat box, which I then want to forward to the windows machine on eth 1. Both the FPGA and the windows box are on different subnets, and the redhat machine is being used because the fpga has a 40G line coming out of it and the windows machine doesn't have a 40G card (the data rates for this particular case are low enough that the 40G line isn't anywhere close to necessary - it shouldn't overflow the 1G line out on eth1). I have tried this (to no avail):
sudo iptables -t nat -A POSTROUTING -d <windows ip> --out-interface eth1 -j MASQUERADE
sudo iptables -A FORWARD -d <fpga's ip> --in-interface eth0 -j ACCEPT
I have already modified sysctl to allow forwarding via ipv4.
If I open the floodgates and tell the redhat machine to send everything it gets on eth0 to eth1, it sends out some sort of mDNS query on eth1 and doesn't end up forwarding anything... I'm using wireshark to look at traffic on the redhat box.
I'm not a networking guy, so an explanation of what I'm doing/not doing would be appreciated.
Thanks.
EDIT: Maybe I need to clarify one point: the FPGA packets' destination ip is not the windows machine; it is the redhat box. I want redhat to send a copy of the packet to windows.
UPDATE:
After a bit of poking around; I found the answer: the MAC Address of the FPGA and the mac address of the redhat 40G card were not synced properly. Fixing this solved my problem.