LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Enable SNAT with IPTABLES on FC5 (https://www.linuxquestions.org/questions/linux-networking-3/enable-snat-with-iptables-on-fc5-574492/)

fayax 08-03-2007 09:28 AM

Enable SNAT with IPTABLES on FC5
 
I have this setup on my FC5 machine.

WAN Interface (eth1)
IP: 10.12.69.3
Mask: 255.255.255.0
GW: 10.12.69.2


LAN Interface (eth0)
IP: 192.168.1.3
Mask: 255.255.255.0

I want to enable NAT with iptables on this machine. And to host service on port 25 and 110 where internet users can access the service.
I have enabled port forwarding on my router to 192.168.1.3

I greatly appreciate if anyone could help me with this.

Thanks in advance.

artiomix 08-03-2007 10:05 AM

Try this iptables rule to enable NAT for 192.168.1.0 network:

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

make sure that 'nat' table is flushed (iptables -t nat -L) or flush it by command 'iptables -t nat -F'.

After NAT is enabled just put 192.168.1.3 as default gateway entry at 192.168.1.0 network subscribers' PCs.

Good luck!

sckirklan 08-03-2007 10:14 AM

Does not your router already support masquerading if you're using privates on that email box?

fayax 08-03-2007 10:45 AM

I want to create SNAT. Not masquerade.

sckirklan 08-03-2007 12:15 PM

iptables -t nat -a POSTROUTING -o $WAN -j SNAT --to $WANIP

However, I suspect if your router is a masquerading to your private addressed server you've still more work ahead of yourself.

fayax 08-03-2007 03:31 PM

Quote:

Originally Posted by sckirklan
iptables -t nat -a POSTROUTING -o $WAN -j SNAT --to $WANIP

However, I suspect if your router is a masquerading to your private addressed server you've still more work ahead of yourself.

What else do i need to do?


All times are GMT -5. The time now is 04:13 AM.