I want a service to be running on every external port on my system. Since it wouldn't work to start 65535 single instances of that service (I guess...) I thought of using iptables for this.
The service (just a 10 line Python script) is listening on localhost:10000. iptables should now forward every TCP-request on an external port to this local port so that each of these ports seems to be open. I have only few experiences with iptables and no time to read more about this subject, so I cannot quite get this to work.
I tried:
iptables -A PREROUTING -t nat -i eth0 -p tcp -j DNAT --to-destination 127.0.0.1:10000
But when scanning from within the local network all the ports appear filtered, not open. There are no other rules currently active and the policies are all set to ACC
How can I get that right?
Thanks in advance!