LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 09-03-2005, 12:58 PM   #1
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Rep: Reputation: 17
How do I keep gateway route across restarts?


I've been having some problems switching from using static addresses to using dynamic addresses. Most of these seem to have been ironed out, thanks to help that I have gotten here. For which I am eternally grateful.

But to fix the problem and be able to access the internet, I have to type "/sbin/route add -net 0.0.0.0 gw 192.168.2.1" every time after booting up. It is not all that difficult, of course, but there must be some way not to have to do it every time.

I tried entering that command in /etc/rc.d/rc.local but that didn't do the job. "netstat -rn" shows no gateway after the system restarts.

I then tried entering "GATEWAY=192.168.2.1" in /etc/sysconfig/network but that didn't do the job either. "netstat -rn" shows no gateway after restart.

I suspect there might be some sort of basic reconfiguration necessary, but do not know what it is. Any suggestions will be greatly appreciated.
 
Old 09-03-2005, 01:18 PM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
I entered a default gateway using WebMin. It works like a charm. The only thing I can nit tell you is what file gets updated.
 
Old 09-04-2005, 06:11 AM   #3
rmic
LQ Newbie
 
Registered: Aug 2005
Posts: 10

Rep: Reputation: 0
Hi,

You talk about using dynamic ip addresses, are you using a dhcp server ? You could add a line in its configuration file to define automatically the default gateway. (option routers 192.168.2.1)

If not, did you take a look at the /etc/sysconfig/network-scripts/route-* files ?

To get these files to work, simply create a file named route-<dev> in the /etc/sysconfig/network-scripts/ directory. Replace <dev> with your device name (eth0 for example)

This file should contain one line like the following :

0.0.0.0/0 via 192.168.2.1


Hope this helps...
rmic
 
Old 09-04-2005, 07:35 AM   #4
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Original Poster
Rep: Reputation: 17
Thanks. That might very well do it, and I'll check it out. For now, I have solved the problem by just changing the eth0 configuration on each Linux box back to using static addresses (since the IP address they have been assigned by the router will not change), and manually entering the IP address, the gateway address and the DNS server addresses. Not elegant, but it take care of the problem. Thanks again.
 
  


Reply



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
multi hop gateway route thllgo Linux - Networking 4 04-06-2009 01:02 PM
My gateway can't route michaelsanford Linux - Networking 0 04-20-2005 05:05 PM
default route without a gateway scylla Linux - Networking 1 10-21-2004 01:40 AM
Route and Gateway Issues shaggz Linux - Networking 2 10-29-2003 12:33 PM
Ip Route Voice Gateway digicom Linux - Networking 1 08-22-2001 10:43 AM

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

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