LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-22-2007, 11:29 AM   #1
immortaltechnique
Member
 
Registered: Oct 2006
Location: Kenya
Distribution: Ubuntu, RHEL, OpenBSD
Posts: 287

Rep: Reputation: 32
NATing in linux


Hi all i want to do away with a hardware firewall and i have the option of implementing NAT on my linux box.
I have 1 interface with a public ip and its default gateway is the router. I want to use the other interface as as the default gateway for the entire lan.
My question is since i have several domains with different ips how do i implement NATing or should i use Ip-Tables?
 
Old 03-22-2007, 12:05 PM   #2
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
Do you mean that you are going to replace your router with your Linux computer? You can use multiptle IP addresses per device.
 
Old 03-22-2007, 01:04 PM   #3
mether
Member
 
Registered: Mar 2007
Distribution: RHEL, Fedora, Open Suse
Posts: 151

Rep: Reputation: 31
Adding multiple rules for nat is no harm. If u have multiple IPs then u can make a range of IPs. But if u have multiple subnets then add multiple rules. Simple IP forwarding can also help if you have only single domain.
 
Old 03-23-2007, 01:09 AM   #4
immortaltechnique
Member
 
Registered: Oct 2006
Location: Kenya
Distribution: Ubuntu, RHEL, OpenBSD
Posts: 287

Original Poster
Rep: Reputation: 32
OK i do have a router but the thing is i have multiple subnets with different ips ie 172.x.x.x and 192.x.x.x My other idea was to use one interface on my linux server to NAT all the private ips to the second interface with a Public ip which is facing the internet: a 212.x.x.x

At the same time i have a web and mail server which will not be visible from the internet. So the alternative is to use the firewall which i really want to get rid of. Yes i can implement the linux firewall but my issue is with Nating
 
Old 03-24-2007, 08:38 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
not really sure what you want to achieve here. at a simple routing level, you can put both 192.168.0.0/24 and 172.16.0.0/24 on the same physical nic if you wish to, nothing wrong with that. if you then have a number of public ip addresses being routed towards you, it's a simple iptable rule to nat each public ip to a matching private one if that's required.

note though that you don't need multiple mail servers and web servers (and therefore ip's) to host multiple domains.
 
  


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
routing and NATing mwagz Linux - Networking 1 01-31-2007 03:39 AM
nating problem bondoq Linux - Networking 8 05-27-2006 07:02 AM
Problem with NATing gpagedar Linux - Networking 5 01-28-2006 08:04 PM
iptables twice nating beno123 Linux - Networking 0 07-27-2005 02:41 AM
Nating ... suvajit Linux - Networking 3 05-15-2003 07:09 AM

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

All times are GMT -5. The time now is 10:39 PM.

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