PDA

View Full Version : SLES10SP3 (from the oes2) and port redirection on other Host



skoltogyan
02-Dec-2014, 07:00
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

skoltogyan
02-Dec-2014, 08:14
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
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