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.
Hello,
This problem has probably been asked and answered 1,000 times already, I just can't find the right search terms. So please just point me in the right direction. I will RTFM.
I wanted to create an intranet (home net), and have a second connection go to the internet (global net). I can setup routing for the local router to assign addresses on the intranet just fine.
What I have trouble with is telling Linux to send packets for other addresses than 192.168.1.XXX to the global network interface, and vice versa. It seems Linux just chooses one or the other interface and puts every packet onto it assuming they will reach their destination -- when they will not.
I also need to know how, if one link goes down, to make Linux NOT send all the packets for that interface out the other one. Linux appears to assume that the links are a redundancy measure by default, not 2 different networks.
From your post it appears you want to build a router. A quick search here and the Internet will find many guides.
Basically to route traffic from one interface to another you need to enable ip_forward which is a kernel parameter i.e. echo 1 > /proc/sys/net/ipv4/ip_forward and can be set permanently in your sysctl.conf. There is a similar configuration for IPV6 if needed. Using masquerade firewall rules you can setup a NAT router.
If you are just starting out then it might be a better idea to begin with NFTables instead. First that's where all the development is currently happening. Second, NFTables is planned to replace IPTables sometime, though the latter has a tragicomically long tail due to all the easily found but outdated material out there on the web.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.