How to forward packets between two dedicated servers?

Hi,

Simple question, how to make one dedicated server as a router to forward traffic on second? Both of them running on CentOS.

Any host with 2 nics and ipforwarding is a router. The trick is getting the routes distributed, which means running a compatible routing protocol daemon. You can just install routes where they are needed, too, but for global traffic, these have to be shared out through the routers. Sometimes this is a security concern with the outer layers.

Assuming your router system has two NICs installed, cabled correctly, and operational.

# echo 1 > /proc/sys/net/ipv4/ip_forward

to enable routing.

You can then use the

# ip route ...

command to manipulate the routing tables.

There are lots of detailed tutorials available on the Internet.