LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How do I freeze my route configurations? They always get reconfigured on reboot. (https://www.linuxquestions.org/questions/linux-networking-3/how-do-i-freeze-my-route-configurations-they-always-get-reconfigured-on-reboot-251748/)

brynjarh 11-06-2004 06:38 AM

How do I freeze my route configurations? They always get reconfigured on reboot.
 
Every time I reboot I need to do..
Code:

route del default
route add -net fjoltengi netmask 255.255.255.255 gateway 10.9.12.1 eth0

..so that my route configurations are correct. It would be nice if I wouldn't have to do this every time I reboot.

So how do I freeze my route configurations so that they do not change on reboot? I can't seam to find any information on how to do it. :/

n0sr 11-06-2004 06:41 AM

If you have /etc/rc.d/rc.local you can add those commands into this file and they will run as the very last thing in the system startup process.
If you wanted to add them in with the rest of the networking inititlization, you can add them into /etc/rc.d/rc.inet1 at the end of the file.

brynjarh 11-06-2004 08:08 AM

There is no /etc/rc.d/rc.local or /etc/rc.d/rc.inet1, I'm using Debian.

Anyway that doesn't really sound like a solution, more of a workaround. What I would really like to do is to define my routing configuration and keep them that way, it sounds logical to me that I should be able to configure my routing and keep that configuration, I don't really grasp why the routing should be reconfigured on reboot.

Is there no way to define the routing without having to do it every time you reboot?

Wordan 11-06-2004 08:21 AM

Im having a problem keeping my gateway

I found this file, I havent restarted yet to find out if it fixed my problem

/etc/network/interfaces

I know little about route, or what your command does, so this probably isnt what your looking for

brynjarh 11-06-2004 09:06 AM

Wordan, could I see your /etc/networks/interfaces file so I can see how you changed it to have a specific gateway?

It might be what I'm looking for, I don't know, does ifconfig use this file at boot time? If not then what?

Wordan 11-06-2004 10:25 AM

Debian woody
Code:

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation# (network, broadcast and gateway are optional)
auto eth0
iface eth0 inet static
        address 192.168.0.5
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.253

I think this is the right thing
see ~$ man interfaces

I just changed the gateway line

Wordan 11-06-2004 10:38 AM

route add -net fjoltengi netmask 255.255.255.255 gateway 10.9.12.1 eth0

what does this do?

n0sr 11-06-2004 08:17 PM

Sorry, but each time your system boots, it has to re-configure your network interfaces and set up the routing. Unfortunately your startup scripts don't set them up correctly. So it may appear to be a kluge fix, but it is how every system (including non-linux) does it.

I'm not a Debian user, but I believe the default file that sets up the network is /etc/init.d/network

You should be able to add your route commands to the end of this file.


All times are GMT -5. The time now is 10:36 AM.