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.
I am trying to setup ip masquerading on my home network but am having some troubles!
My first machine (router) has two interfaces eth0,eth1. eth0 is on the internet, eth1 internal. I have tried to setup masquerading with the following rules.
I have looked at the output of route on the router machine and it appears that the IP address given for nexthop is the default gateway for eth1 (the internal interface).
Within 'ifcfg-eth1' no gateway is set up. Does this need to be done?
To my mind this seems to mean that iptables is trying to pass the masqueraded packets through the wrong interface, even though the '-o' option is set to eth0 (external interface).
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857
Rep:
Here is how I usually set it up:
I configure the external NIC with the gateway and IP addy that my ISP provides. I configure the internal NIC with an internal IP but I use the external NIC as the gateway. All of that shows up in the ifcfg-eth? scripts.
I make sure that I have ip_forward on and I set the MASQ up in IPCHAINS. Restart your network after doing all that and you shouuld be good to go.
The routing should be set up correctly automatically once you get the other IP info correct for each NIC.
Thanks for your help kevin. It turned out in the end to be a spurious entry in /etc/sysconfig/network. I believe this was caused by the use of the 'netconfig' program. I had originally configured everything by hand, and when it didn't work I used this program! Guess that'll teach me for trying to do things the quick way!!!!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.