I'm trying to come up with an iptables rule whereby I can redirect all tcp traffic incoming on eth0 to 127.0.0.1:1234. I will then listen on 127.0.0.1 with my C program and print the raw packets to console. Is this possible? Or am I going about this in completely the wrong way?
Please bear in mind that my iptables knowledge is very limited.
Here's what I've tried sofar:
sudo iptables -A INPUT -s 127.0.0.1 -p tcp -j DROP
but I don't want to DROP - I want to forward to 127.0.0.1:1234!