Howdy, Stranger!

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


How to ip route/forward all incoming traffic from one public lP to another in different DC?
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.

How to ip route/forward all incoming traffic from one public lP to another in different DC?

trusty33trusty33 Member
edited September 2019 in Help

Hello, i am not sure if/how this is possible.

Server has its lPv4 and it got a few another additional public lPv4 and i want to redirect all traffic from one of these additional lPs (1.2.3.4) to different lP that is not mine and is not r0uted to my server (6.7.8.9)

Per the lP r0ute, the 1.2.3.4 is assigned(not likely right word) to a interface venet0
Gateway lP for my server is 12.34.56.78.

How do i do the lP route command to setup route/forwarding from 1.2.3.4 to 6.7.8.9 (which is in different DC)?

PS: I have found rules for lPtable_nat, but my kernel/lPtables is not compatible with it

Comments

  • Not a routing expert but most places require you to have at least a /24

  • deankdeank Member, Troll

    Someone's using LET as a support desk.

  • @deank said:
    Someone's using LET as a support desk.

    please rate our support

  • is this near?
    ip route add nat 1.2.3.4 via 6.7.8.9

  • jackbjackb Member, Host Rep
    edited September 2019

    @AlexJones said:
    Not a routing expert but most places require you to have at least a /24

    This sort of thing should be achievable with dnat (though not for OP due to OpenVZ or some other system with a limited kernel)

  • @jackb said:

    @AlexJones said:
    Not a routing expert but most places require you to have at least a /24

    This sort of thing should be achievable with dnat (though not for OP due to OpenVZ or some other system with a limited kernel)

    I thought he was speaking literally not I want to tunnel 1 server to another

  • In your case you can proxy but not route. To route something the traffic must cross your server bidirectional.

    Thanked by 1kkrajk
  • @jackb said: should be achievable with dnat (though not for OP due to OpenVZ or some other system with a limited kernel)

    I mean the routing would be done by the host server (node) not from within VPS. So i do not think we can talk about limitted kernel. Only old kernel (< 3.x). So if my iptables/kernel version does not support iptable_NAT (to create NAT rules, how do i create route using "ip" linux command (if that is doable for the case i describbed)?
    If you know how to do it via iptables and kernel newer than mine. Please share it even i may not use it myslf, others can.
    Recently, thanks to cryptostorm.is i seen following advice:

    iptables -t nat -A PREROUTING -p tcp -d $inst --dport $port -j DNAT --to $ip:$port
    iptables -t nat -A PREROUTING -p udp -d $inst --dport $port -j DNAT --to $ip:$port

    where $inst is that OpenVPN instance's public IP (the one the internet sees you as having), and $ip is your internal 10.x.x.x IP, and $port is the port to forward

    (i have not tried it since error: )
    so thus i am wondering about "ip route" command.

  • RickBakkrRickBakkr Member, Patron Provider, LIR

    You can just run a GRE tunnel between the two hosts to simulate a direct link and route the subnet over that. Just be sure traffic for your IPs is delivered at your server (say: routed), instead of bridged - or you'd have to play with some ARP magic.

  • terrahostterrahost Member, Patron Provider

    Try redir or rinet.d :) Should do what you want.

Sign In or Register to comment.