OVH Community, your new community space.

Routing traffic between servers.


stoner
28-05-2010, 23:00
Thanks freshwire I will give that a go over the weekend

freshwire
28-05-2010, 16:58
One nice solution I sometimes use is PacketProxy. You just run the program with some command line args and it will forward traffic on particular ports.

http://www.cs.uit.no/~daniels/PacketProxy/index.html

Otherwise the following should do the trick with iptables.

Code:
# rewrite incoming packets with new destination
iptables -t nat -A PREROUTING -d 1.2.3.4 -p tcp -j DNAT --to-destination 5.6.7.8

# rewrite source of outgoing packets  
iptables -t nat -A POSTROUTING -p tcp -d 5.6.7.8 -j SNAT --to-source 1.2.3.4

# apply the rule to packets we generate
iptables -t nat -A OUTPUT -p tcp -d 1.2.3.4 -j DNAT --to-destination 5.6.7.8
In the above 1.2.3.4 is the server the traffic is going to and 5.6.7.8 is the new target you want it to go to.

Note that all traffic will appear to come from 1.2.3.4.

stoner
28-05-2010, 11:14
How to route traffic to another ovh server ?

Is there a way to route traffic from an ovh server to another, no matter their datacenter/ip, like from 188.165.200.x to 91.121.14.x ? Using iptables