LinuxQuestions.org
Help answer threads with 0 replies.
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 10-24-2003, 11:34 AM   #1
pioniere
Member
 
Registered: Dec 2002
Location: Vancouver Island, Canada
Distribution: Slackware
Posts: 46
Blog Entries: 1

Rep: Reputation: 15
how to set permanent routes?


I have some questions:

-- I am trying to set a permanent default gateway on a RH 7.3 box. There are two NICs installed, and whenever the box is rebooted it chooses a default gw on the 2nd NIC. I want the default gw to be on the 1st NIC. I can manually set it using the route command, but want the change to be permanent. How do I make it permanent?

-- I have another RH 7.3 machine in which, for now, I want to disable the 2nd NIC without removing it from the machine. I can disable the NIC after the machine boots using ifdown, but I want to disable it so when it reboots the 2nd NIC does not come up. How do I disable it?

-- Are there any good books out there that do a good job of explaining how to administer Linux from the command line? Every book I look at focuses on the GUI tools, which I don't want to use. If I had such a book, I might not have to post questions like the above. I have also checked out TLDP, but it seems to talk about everything with the exception of what I need. Can anyone recommend a book of this type?

Any help on these questions is appreciated, thanks.
 
Old 10-24-2003, 12:56 PM   #2
Dewar
Member
 
Registered: Sep 2003
Location: Washington State
Distribution: SuSE 8.0, SuSE 9.0, Slack 9.1
Posts: 90

Rep: Reputation: 15
I can help with part one. I suppose there are a lot of ways to fix this problem, but since you already know how to change the route manualy, you can put that command in a bash script, and then run it at start up.

Though I don't know the specifics of RedHat, I believe all you have to do is put the line "#!/bin/sh" into a file named something like S99route (the capital S99 is manditory,) put your routing command on the next line, chmod it so it's executable, and then copy it into the /etc/rc.d/rc3.d and /etc/rc.d/rc5.d directories.

That was just a brief description, if you need more, I'd be happy to help

-Derek

*Edit*

I suppose you can do the same thing with the ifdown command to take down the interface automaticaly upon startup
 
Old 10-24-2003, 12:57 PM   #3
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
I can't recommend a book but if you are really wanting to LEARN command line I suggest you move to a distribution who focuses more on that - like Debian, Slackware or some other.

For the networking: Check out /etc/sysconfig/network-scripts - if I remember correctly this is the directory you are looking for ...
 
Old 10-24-2003, 03:45 PM   #4
silatts
LQ Newbie
 
Registered: Oct 2003
Posts: 19

Rep: Reputation: 0
Re: how to set permanent routes?

Quote:
Originally posted by pioniere
I have some questions:

-- I am trying to set a permanent default gateway on a RH 7.3 box. There are two NICs installed, and whenever the box is rebooted it chooses a default gw on the 2nd NIC. I want the default gw to be on the 1st NIC. I can manually set it using the route command, but want the change to be permanent. How do I make it permanent?
just edit the files in /etc/sysconfig/network-scripts

there should be 2,. ifcfg-eth0 and ifcfg-eth1

swap their contents over - I am sure there's another way - but that should work

Quote:
-- I have another RH 7.3 machine in which, for now, I want to disable the 2nd NIC without removing it from the machine. I can disable the NIC after the machine boots using ifdown, but I want to disable it so when it reboots the 2nd NIC does not come up. How do I disable it?
edit /etc/sysconfig/network-scripts/ifcfg-eth1

change the
ONBOOT=yes
to
ONBOOT=no

Quote:
-- Are there any good books out there that do a good job of explaining how to administer Linux from the command line? Every book I look at focuses on the GUI tools, which I don't want to use. If I had such a book, I might not have to post questions like the above. I have also checked out TLDP, but it seems to talk about everything with the exception of what I need. Can anyone recommend a book of this type?

Any help on these questions is appreciated, thanks.
most answers I know to are by looking at what the scripts in init.d do and shell script that does the ifup thing

Sil
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
set permanent read-write permission on shares Randall Slack Linux - Networking 1 10-30-2005 08:54 PM
permanent module options: where to set? mehlkelm Debian 2 09-20-2005 02:18 AM
Routes Obie Linux - Networking 16 04-28-2005 10:15 PM
routes himyuza *BSD 6 08-03-2004 10:41 AM
debian - make routes permanent codeape Debian 2 02-14-2004 01:18 PM

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

All times are GMT -5. The time now is 08:52 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