LinuxQuestions.org
Visit Jeremy's Blog.
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 01-28-2009, 06:19 PM   #1
compucoder
LQ Newbie
 
Registered: Jan 2009
Posts: 17

Rep: Reputation: 0
NAT to different Public IP's


Hi everyone,

I am getting a second internet connection into the office next week and will probably post how to use both at the same time using my Linux firewall(Ubuntu / Shorewall).

For now though, I am trying to accomplish this:

We have 5 static IP's and I have everything working. 1 IP bound to eth1 and the other 4 bound to virtual interfaces, eth1:1, etc.

I also have static NAT or 1-1 NAT on 3 of the virtual adapters going right to our hosting servers. This seems to work fine. I don't know if SNAT / 1-1 was the right way but I needed these servers to respond using the proper public IP I assigned the DNS to.

So, overall things seem to work fine for all traffic inbound.

What I am trying to do now is route some of our internal clients through my free public IP. I use Shorewall on Ubuntu 8.10 server if that matters.

So in my MASQ file I have eth0 going to eth1. This is allowing all computers on our 192.168.1.x subnet to access the internet.

I want to take a few of these clients and put those through the same eth1 interface but not using the eth1 IP. I want those few clients to use my free public IP. I tried adding a new MASQ rule above the default one and for the source I used my LAN IP and the Dest I chose eth1 and provided a specific public IP. This doesn't seem to work. Once I do this, I checked what my external IP was reporting as and it never changed. I tried different things in the MASQ file and it always reports the 1 IP bound to eth1.

Does anyone know what I need to do to have a few clients NAT on a different IP than the one bound to eth1?

The reason I am trying this is when I figured I'll need to know this when I get the second internet connection next week. Only a few clients on the same LAN subnet will be using this second connection. I am sure I'll have to post for help though. It doesn't seem simple.

Thanks for any help you can offer.
 
Old 01-29-2009, 09:26 PM   #2
compucoder
LQ Newbie
 
Registered: Jan 2009
Posts: 17

Original Poster
Rep: Reputation: 0
I think I figured out some portion of this. I did some more checking and if you prepend your interface name with + it will supersede 1-1 NAT rules. Not sure why that matters as 1-1 / SNAT had nothing to do what I was trying to do but it seems to work. Just changed by external interface from eth1 to +eth1

Strange.
 
  


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
Howto setup iptables firewall and DMZ with multiple public IP's ? hendrixx Linux - Networking 2 11-30-2008 08:03 AM
Why am I seeing private ip's on a public network rbees Linux - Networking 2 11-06-2008 06:54 PM
IPTables - Multiple Public IP's to private IP's matneyc Linux - Security 8 05-27-2005 12:23 PM
adding public ip's TurboChicken Linux - Networking 3 11-12-2004 06:58 AM
I want to nat 2 IP's to the mail server in the DM Zone devanand_n Linux - Networking 1 08-07-2001 09:02 AM

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

All times are GMT -5. The time now is 10:15 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