problem:
I have servers:
Server1(172.16.16.10)
Server2(172.16.16.20)
Server3(172.16.16.30)
I need Redirect packets From Server2 to the Server3 if
Source=172.16.16.10
proto=tcp
dstport=25
Fore Example:
Fromethe console Server1 i do:
telnet 172.16.16.20 25
and Server2 redirect this SMTP packets to the 172.16.16.30:25
and Telnet connected to the SMTP server on the server 172.16.16.30
Please, Help me.
Serg
[QUOTE=skoltogyan;25191]problem:
I have servers:
Server1(172.16.16.10)
Server2(172.16.16.20)
Server3(172.16.16.30)
I need Redirect packets From Server2 to the Server3 if
Source=172.16.16.10
proto=tcp
dstport=25
Fore Example:
Fromethe console Server1 i do:
telnet 172.16.16.20 25
and Server2 redirect this SMTP packets to the 172.16.16.30:25
and Telnet connected to the SMTP server on the server 172.16.16.30
Please, Help me.
Serg[/QUOTE]
Resolved.
Help this: http://www.simplehelp.net/2009/04/15/how-to-redirect-traffic-to-another-machine-in-linux/
This is on the Server2( 172.16.16.20):
iptables -t nat -A PREROUTING -s 172.16.16.10 -p tcp --dport 25 -j DNAT --to-destination 172.16.16.30
iptables -t nat -A POSTROUTING -p tcp -d 172.16.16.30 --dport 25 -j MASQUERADE