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. |
|
 |
10-21-2010, 07:54 AM
|
#1
|
|
LQ Newbie
Registered: Feb 2005
Location: Charleroi, PA 30 mi SE of Pgh
Distribution: RedHat, Fedora, Oracle
Posts: 14
Rep:
|
IPTables NAT Problem
I have IPTables setup and mostly working. I have two interface, inside & outside. All traffic from inside goes out and works fine. All traffice from outside goes where it should. My problem is that I have DNAT setup for two outside addresses to 2 inside addresses. From inside I can only access the boxes via their inside address, I can not access the outside address. Can someone please help me? I have been reading, and I believe I may need to use SNAT and/or add some DNAT statements. I am running on Fedora 10. Below is the /etc/sysconfig/iptables file with outside addresses top level masked.
*nat
:OUTPUT ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o eth1 -j MASQUERADE
-A PREROUTING -p tcp -m tcp -d xx.xx.xx.21 -j DNAT --to-destination 192.168.100.3
-A PREROUTING -p tcp -m tcp -d xx.xx.xx.18 -j DNAT --to-destination 192.168.100.1
COMMIT
*filter
:FORWARD ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:MASQ-FORWARD - [0:0]
:OUTPUT ACCEPT [0:0]
-A FORWARD -s 192.168.100.0/23 -o eth1 -j MASQ-FORWARD
-A MASQ-FORWARD -s 192.168.100.0/23 -o eth1 -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -p all -s 192.168.100.0/23 -j ACCEPT
-A INPUT -p all -s xx.xx.xx.0/25 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth0 -j ACCEPT
-A INPUT -p udp -m udp --sport 3307 -j ACCEPT
-A INPUT -p udp -m udp --sport 123 -j ACCEPT
-A INPUT -p udp -m udp --sport 13 -j ACCEPT
-A INPUT -p tcp -m tcp --sport 13 -j ACCEPT
-A INPUT -p tcp -m tcp --sport 20 -j ACCEPT
-A INPUT -p tcp -m tcp --sport 21 -j ACCEPT
-A INPUT -p tcp -m tcp --sport 69 -j ACCEPT
-A INPUT -p udp -m udp --sport 37 -j ACCEPT
-A INPUT -p tcp -m tcp --sport 37 -j ACCEPT
-A INPUT -p tcp -m tcp --sport 80 -j ACCEPT
-A INPUT -p tcp -m tcp -m state --dport 3307 --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state --dport 20 --state NEW -j ACCEPT
-A INPUT -p udp -m udp -m state --dport 20 --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state --dport 21 --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state --dport 80 --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state --dport 10000 --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp -m state --dport 20000 --state NEW -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
*mangle
:FORWARD ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed
|
|
|
|
10-21-2010, 12:30 PM
|
#2
|
|
Member
Registered: Aug 2007
Location: INDIA
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, PCLinuxOS
Posts: 132
Rep:
|
You are right. Just try SNAT.
|
|
|
|
| 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 09:01 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
|
|