Re: SNAT Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Burton schrieb:
I need help setting up a server I am working with.
I am not very knowledgeable in regards to Linux. With that in mind I have read several HOWTO's and I am convinced that SNAT
is what I need to do this.
What I am trying to do is I have to servers on two different T1's located on
the same switch.
I would like server1 (my Linux Server) to accept an incoming connecting via
its IP address on T1(1) 12..22.81.18 on port 10025 and forward that request
to server2(my Windows Mail Server) on T1(2) 204.250.113.2 on port 25
I have tried several combinations of iptables -t nat -A POSTROUTING -p tcp -o eth0 -j SNAT --dport 10025 --to
204.250.113.2:25 What am I doing wrong or am I looking at the wrong tool.




You need DNAT not SNAT ;). And you need a apropriate FORWARD rule if your default policy is DROP.


iptables -t nat -A PREROUTING -i ethx -p tcp --dport 10025 -j DNAT --to 204.250.113.2:25

iptables -t filter -A FORWARD -i ethx -d 204.250.113.2 -o ethx -p tcp --dport 25 -j ACCEPT


--

PGP-ID 0xF8EAF138

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux