New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Forward all ports on a ip to another?

in Help
Hello, as the topic says do anyone know how to forward all ports on a ip to another ip?
Comments
Try this.
Thanks but is it possible to forward all ports without making that commands for every port?
With what, iptables?
Also I doubt you want to forward all ports, if you do you might get locked out of crucial services such as SSH. Something along this line should work
iptables -t nat -A PREROUTING -p tcp --dport 1024:65535 -j DNAT --to-destination 10.9.0.18:1024-65535
Make sure to change the destination IP.Okay thanks!
I'm getting this error with that command
Open ticket and ask your provider to enable nat , or if it's your openvz node:
nano /etc/modprobe.d/openvz.conf
and change
options nf_conntrack ip_conntrack_disable_ve0=1
to
options nf_conntrack ip_conntrack_disable_ve0=0
Thanks for helping.
You can use Haproxy too for that http://haproxy.1wt.eu/
But how to forward all ports with it?
You can try rinetd.