Linux - NetworkingThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.