Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Forward all ports on a ip to another?
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.

Forward all ports on a ip to another?

Hello, as the topic says do anyone know how to forward all ports on a ip to another ip?

Comments

  • SteveSteve Member
    edited May 2014
  • Thanks but is it possible to forward all ports without making that commands for every port?

  • MakenaiMakenai Member
    edited May 2014

    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

    iptables v1.4.14: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
    Perhaps iptables or your kernel needs to be upgraded.
    
  • 5n1p5n1p Member

    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

  • @5n1p said:
    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/

  • @IxamHosting said:
    You can use Haproxy too for that http://haproxy.1wt.eu/

    But how to forward all ports with it?

  • XSXXSX Member, Host Rep

    You can try rinetd.

Sign In or Register to comment.