LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-17-2009, 02:41 PM   #1
Robeasts
Member
 
Registered: Dec 2005
Distribution: Ubuntu 6.10, Simply MEPIS 6.0
Posts: 35

Rep: Reputation: 15
No NAT on inside (Green) Interface of IpCop Server


I have an IpCop server with two NICs (Red, Green). The internal NIC is 192.168.121.1 and the external NIC is 10.3.101.2. I would like all traffic from the Internal network (192.168.121.0) destine for the following Networks 192.168.1.0, 192.168.2.0 to NOT be NAT'd. I've done some research and found some things about Source NAT and Destination NAT, but I'm not sure this what I need. I'm familiar with this on PIXs but not a linux box. I've posted in this forum because this is out of the scope of IpCop. Thanks any help is greatly appreciated.
 
Old 06-23-2009, 10:17 AM   #2
jhannah
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Rep: Reputation: 0
I'm not sure if this is different for IpCop but you should be able to simply add a rule at the top of the POSTROUTING chain which explicitly permits that traffic out without jumping to the MASQ target. Something like the below should do the trick:

iptables -t nat -I POSTROUTING 1 -d 192.168.2.0/24 -j ACCEPT
iptables -t nat -I POSTROUTING 1 -d 192.168.1.0/24 -j ACCEPT

Check out what the rules look like using:

iptables -t nat -Lnv

This will cause iptables to route traffic to those networks but not mangle any of the IP addresses along the way so you will need to have a means to reach those networks and routes for all three networks.

Hope that helps.

Jon Hannah
Sr. Network Engineer
jhannah@hostmysite.com
HostMySite.com

Last edited by jhannah; 06-24-2009 at 09:10 AM.
 
Old 06-24-2009, 10:01 AM   #3
Robeasts
Member
 
Registered: Dec 2005
Distribution: Ubuntu 6.10, Simply MEPIS 6.0
Posts: 35

Original Poster
Rep: Reputation: 15
No NAT on inside (Green) Interface of IpCop Server

Thanks for the reply. I looked up this command in the iptables man pages and it makes sense to me and is what I'm looking for, but I would just like to verify. What is the 1 after the POSTROUTING?

iptables -t nat -I POSTROUTING 1 -d 192.168.2.0/24 -j ACCEPT
iptables -t nat -I POSTROUTING 1 -d 192.168.1.0/24 -j ACCEPT

Is that the interface that the packet is going out? Here is some info:

eth0 - RED Interface, external NIC - IP Address 10.3.101.2
eth1 - GREEN Interface, internal NIC - IP Address 192.168.121.1

Thanks again for the help. It would have took me forever to develop this.
 
Old 06-25-2009, 01:48 AM   #4
jhannah
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Rep: Reputation: 0
The one after POSTROUTING puts the rule at the top of the POSTROUTING chain. This makes sure that the rule is processed before the default MASQ rule. That results in traffic to those networks not being NATed but everything else falling through to the default MASQ rule.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NAT server proxy settingon outside interface HDWorx Linux - Networking 5 02-23-2008 05:26 PM
IPCop Rx errors on Green bandad Linux - Networking 2 03-15-2007 02:27 AM
IPcop Orange and Green problem Es-web Linux - Security 1 09-17-2005 01:37 PM
IPcop: How do I open ports for all of the green network? Moses420ca Linux - Networking 0 07-26-2004 01:23 PM
Can IPCop do inside,outside NAT? chort Linux - Networking 0 07-01-2003 06:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration