Howdy, Stranger!

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


In this Discussion

Redirect traffic from secondary VPS IP to a private VPN IP
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.

Redirect traffic from secondary VPS IP to a private VPN IP

Hi, I have one VPS with 2 IP addresses and I wouls like to use secondary IP and forward all traffic to a internal private IP (in fact is an VPN ip inside of my home network).

Example --> Forward all traffic to IP 80.10.10.1 to internal IP --> 192.168.25.2

[root@d ~]# sysctl -p
net.ipv4.ip_forward = 1

So in the public VPS I'm using csf and webmin (openVZ).

çWhat's the easiest way to do this ?

Can I just use /etc/csf/csf.redirect to do this ?

Thanks.

Comments

  • CryckCryck Member
    edited July 2015

    I would solve this with IPtables.

    iptables -t nat -A PREROUTING -p tcp -i eth0 -d 1.2.3.4 -j DNAT --to-destination 10.11.12.13
    iptables -t nat -A PREROUTING -p udp -i eth0 -d 1.2.3.4 -j DNAT --to-destination 10.11.12.13

    This rules redirect all incoming TCP and UDP traffic to your internal IP.

  • KeyJeyKeyJey Member

    Won't csf interfere with this ? thanks

Sign In or Register to comment.