Results 1 to 8 of 8
Hello all,
I am currently setting up an Internet gateway with the help of a linux machine. I am using the route command to set up the default gateway, giving ...
- 03-23-2005 #1Just Joined!
- Join Date
- Mar 2005
- Posts
- 5
"route add default gw" command-trouble
Hello all,
I am currently setting up an Internet gateway with the help of a linux machine. I am using the route command to set up the default gateway, giving the addres of the router which connects me to the external world.
The problem now is that, everytime I reboot the linux machine, I have to add the default route, even though the corresponding ethernet interfaces are getting activated automatically.
I use the command "route add default gw 'ipaddress of the router' " command, but I have to do this everytime I reboot.
What could be the possible problem ?are there any files that I need to change ?when I went to the man page of route, it indicated me that changes would be made to the file /proc/net/route, but then automatic gateway setting is not being done here.
Help me out please. Thanks in Advance.
Regards
- 03-23-2005 #2Linux Enthusiast
- Join Date
- Feb 2005
- Location
- SE, Stockholm
- Posts
- 512
What distro are you running on? Because different distros has their own tool to set up the network.
- 03-23-2005 #3Just Joined!
- Join Date
- Mar 2005
- Posts
- 5
I am running RHL9.0. "route" is the command for setting up the routing table.
- 03-23-2005 #4Linux Enthusiast
- Join Date
- Feb 2005
- Location
- SE, Stockholm
- Posts
- 512
Yes that's correct, "route" command will alter your routing table.
But it is not more than untill you reboot your system as you stated previous.
Try the comman netconfig (I think it was that command in RH9 at least), then you will be able to save your parameters and will be able to reboot your system.
- 03-23-2005 #5Linux User
- Join Date
- Oct 2004
- Location
- Serbia&Montenegro
- Posts
- 281
You could make a simple bash script and set it to run every time on boot. I did this in Slackware. Create the script and change the /etc/rc.d/rc.local file. So you should add this in rc.local:
Code:if [-x /path to script/ name of the script ]; then . /path to script/name of the script fiLinux registered user #358842
Human knowledge belongs to the world.
- 03-23-2005 #6Just Joined!
- Join Date
- Mar 2005
- Location
- Milano (Italy)
- Posts
- 45
Hi
in red hats and fedoras there is the directory
where there is a file for each net interface.Code:/etc/sysconfig/network-scripts
I guess the file you are looking for is ifcfg-eth0, edit it
and change the ip address of the gateway.
I hope I was helpful
- 04-17-2005 #7Just Joined!
- Join Date
- Jan 2005
- Posts
- 20
You shoult put line in to /etc/rc.local file
- 08-10-2007 #8Just Joined!
- Join Date
- Aug 2007
- Location
- Midlands, UK
- Posts
- 14




