PDA

View Full Version : setting default GW permanently


hcclnoodles
2005-09-14, 11:00 AM CDT
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

ps my /etc/sysconfig/networking/devices folder is empty

multescugeorge@
2005-09-14, 11:09 AM CDT
use the startup script: /etc/rc.d/rc.local
add those commands at the bottom of the script and they will be executed automaticly at every startup.
insted of :
route ....
use :
/sbin/route .....

mattt
2005-09-14, 01:37 PM CDT
there should be a GATEWAY= in the /etc/sysconfig/network file.

hcclnoodles
2005-09-15, 03:21 AM CDT
thanks matt it is indeed. I was previously advised to look for a file called ifcfg-[interface-name] in the etc/sysconfig/networking/devices folder which is in fact and empty folder..hence the confusion


thanks again

chili555
2005-09-15, 02:44 PM CDT
You want /etc/sysconfig/network-scripts/ifcfg-<interface>

You can edit it to add a line: GATEWAY=87.x.x.129

And shouldn't netmask be 255.255.255.0?