Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Acid, do static routes go there? if so, what's the syntax?
The /etc/sysconfig/network-scripts/ifup-routes specifically looks for /etc/sysconfig/static-routes, if the file isn't found it simply exits, but if not, it parses the entries one line at a time doing a "/sbin/route add -$args" on each entry.
All you should need to do is create that file and put in the following line:
eth0 net 192.168.1.0 netmask 255.255.255.0 gw 192.168.168.72
of course if your nic isn't eth0, use whatever is appropriate for your system.
Yeah, that is how you setup your default gw, but in order to setup a static route you need more information than that. I honestly don't think you can put a static route definition in there. I suspect the script that sources that file is only looking for the information you listed.
The correct way to add a permanent is as follows...
I know this is an old thread but it kills me to see people using the rc.local file for this. This is not the right way to do this.
The correct way to add permanent static routes to a system besides setting the default gateway is to create a file /etc/sysconfig/network-scripts/route-eth0 (or whichever interface you want to route through). You can add as many routes as you would like per interface by simply incrementing the number at the end of each statement. Once saved a restart of the network services will force a read of this route file.
The syntax of the file should look like this: