Linux – Port Forwarding Without Iptables

linuxport-forwarding

I have a Linux VPS (virtuozzo) server and I need to setup port forwarding, but my hosting provider does not allow iptables-nat kernel modules so iptables -t nat – is not working.

I'm looking for other ways how to do it. I know I can forward port using openssh, but I need to forward 20+ different ports, tcp and udp so this is not an option.

Is there is any software for linux that can do port forwarding?

Best Answer

Use the tool called "socat", it is great tool for such things and it is already packaged in many linux distribution. Read about it here : http://www.dest-unreach.org/socat/doc/README

Port forwarding example with socat :

socat TCP4-LISTEN:80,fork TCP4:www.yourdomain.org:8080

This redirect all TCP connections on port 80 to www.yourdomain.org port 8080 TCP.