Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-03-2007, 09:28 AM
|
#1
|
|
LQ Newbie
Registered: Nov 2005
Posts: 15
Rep:
|
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.
|
|
|
|
08-03-2007, 10:05 AM
|
#2
|
|
LQ Newbie
Registered: Apr 2007
Posts: 16
Rep:
|
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!
|
|
|
|
08-03-2007, 10:14 AM
|
#3
|
|
LQ Newbie
Registered: Aug 2007
Location: Kansas, USA
Distribution: Debian Etch, CentOS 5, Fedora Core 5 & 6, Fedora 7, Helix
Posts: 6
Rep:
|
Does not your router already support masquerading if you're using privates on that email box?
|
|
|
|
08-03-2007, 10:45 AM
|
#4
|
|
LQ Newbie
Registered: Nov 2005
Posts: 15
Original Poster
Rep:
|
I want to create SNAT. Not masquerade.
|
|
|
|
08-03-2007, 12:15 PM
|
#5
|
|
LQ Newbie
Registered: Aug 2007
Location: Kansas, USA
Distribution: Debian Etch, CentOS 5, Fedora Core 5 & 6, Fedora 7, Helix
Posts: 6
Rep:
|
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.
|
|
|
|
08-03-2007, 03:31 PM
|
#6
|
|
LQ Newbie
Registered: Nov 2005
Posts: 15
Original Poster
Rep:
|
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?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:13 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|