LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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-14-2005, 11:20 AM   #1
hcclnoodles
Member
 
Registered: Apr 2003
Posts: 50

Rep: Reputation: 15
setting the default GW permanently


Hi there

When setting up my Fedora Core 3 system I accidentally set my default gateway to the wrong address, so the first thing i did when i booted up was to delete the old gateway

"route del -net 0.0.0.0"

and then set a new one .......

"route add default gw 87.x.x.129 netmask 0.0.0.0 eth0"


however, when I reboot, the original (wrong) gateway address comes back again ??

does anybody know which file I edit to set this permanetly ????

any help woul;d be greatly appreciated

Gary
 
Old 09-14-2005, 11:49 AM   #2
Snowbat
Member
 
Registered: Jun 2005
Location: q3dm7
Distribution: Mandriva 2010.0 x86_64
Posts: 338

Rep: Reputation: 30
Assuming it's the same as Mandriva, look in /etc/sysconfig/network
 
Old 09-14-2005, 11:59 AM   #3
hcclnoodles
Member
 
Registered: Apr 2003
Posts: 50

Original Poster
Rep: Reputation: 15
ok as far as im aware it should indeed be in etc/sysconfig/networking/devices but that directory is empty !!

Somebody said on another forum said create a file called ifcfg-eth0 (as eth0 is one of my nic id's) and in that file create a line

GATEWAY=x.x.x.x

but....a) this doesnt work and b) Id like to know where the existing information is stored ....it must be somewhere !!!!!!!!!
 
Old 09-14-2005, 02:04 PM   #4
Snowbat
Member
 
Registered: Jun 2005
Location: q3dm7
Distribution: Mandriva 2010.0 x86_64
Posts: 338

Rep: Reputation: 30
Google indicates /etc/sysconfig/static-routes is another possibility.

Or use grep to find the file - replace IP address below with your wrong gateway:
grep -r '192.168.1.1' /etc/sysconfig
 
Old 09-15-2005, 04:39 AM   #5
linuxmanju
Member
 
Registered: Sep 2003
Location: India
Distribution: Debian
Posts: 50

Rep: Reputation: 15
Well if its not a great solution but this should work. U can put a executable shell script which should read some thing like this
route del default
route add default gw X.X.X.X
and put that file in init.d/ and add that file name along with the path in rc.local
make sure that u make it executable ( The file) run chmod a+x routingfile
 
Old 09-15-2005, 04:58 AM   #6
linuxmanju
Member
 
Registered: Sep 2003
Location: India
Distribution: Debian
Posts: 50

Rep: Reputation: 15
ok as far as im aware it should indeed be in etc/sysconfig/networking/devices but that directory is empty !!
--------------------------------------------------------
By the way isnt it /etc/sysconfig/network-scripts/ifcfg-ethX
where u should look at
 
Old 09-15-2005, 09:38 AM   #7
abhijeetudas
Member
 
Registered: Sep 2004
Distribution: Redhat / Fedora
Posts: 114

Rep: Reputation: 15
Best thing is


make sure that ..

/etc/sysconfig/network-scripts/ifcfg-ethX

of all the files only one of these files have a
GATEWAY=x.y.z.a



and no other file has that keyword in it.

that should about do it.
 
  


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
Setting the xrandr setting permanently dazdaz Linux - Hardware 2 11-24-2005 01:57 AM
Setting the default gateway permanently hcclnoodles Linux - Newbie 5 09-26-2005 04:15 AM
Permanently Setting the Java_Home Dynapen Linux - Newbie 2 08-04-2004 01:53 PM
setting shell limit permanently? Alf829 Linux - General 2 07-30-2003 11:14 AM
setting PATH permanently evian Linux - Software 3 03-14-2003 11:29 AM


All times are GMT -5. The time now is 01:46 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration