Admin Pick Logo
 

Auto Startup Script for Debian Linux (Example is Add Route in Routing Table)

Read More Linux Tutorials
-->

When I configured the Censornet proxy server, I wanted to add static routes in routing table so that computers at subnets can connect to the proxy server.

However, my entered static routes were removed automatically everytime the proxy server restarted. So, I figured out I need to add “Add Route” commands in the startup scripts. This is what I figured out to add commands in start up script in Debian Linux.

First, go to the /etc/init.d/ directory. The files and scripts that listed are the startup scripts that are loaded when Debian starts.

So, to make a startup script, you add a new file under the init.d directory. For my case, I added a “addroute” file by using command: “pico addroute”.

I entered my add route commands and save “addroute” file.

commands that i type in:

route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.4

….and so on.

Then, you have to make the “addroute”, by chmod 755 /etc/init.d/addroute

Then you need to add the appropriate symbolic links to cause the script to be executed when the system goes down, or comes up.

The simplest way of doing this is to use the Debian-specific command update-rc.d addroute defaults

That’s all. Restart your server and see whether your linux load the static routes or not.

source

del.icio.us:Auto Startup Script for Debian Linux (Example is Add Route in Routing Table) digg:Auto Startup Script for Debian Linux (Example is Add Route in Routing Table) spurl:Auto Startup Script for Debian Linux (Example is Add Route in Routing Table) newsvine:Auto Startup Script for Debian Linux (Example is Add Route in Routing Table) blinklist:Auto Startup Script for Debian Linux (Example is Add Route in Routing Table) furl:Auto Startup Script for Debian Linux (Example is Add Route in Routing Table) reddit:Auto Startup Script for Debian Linux (Example is Add Route in Routing Table) Y!:Auto Startup Script for Debian Linux (Example is Add Route in Routing Table) magnolia:Auto Startup Script for Debian Linux (Example is Add Route in Routing Table)

One Response to “Auto Startup Script for Debian Linux (Example is Add Route in Routing Table)”

  1. Me Says:

    This will work. Another way is to add the route command into your interfaces file so that the routes come up with the interface. eg.

    iface eth0 inet static
    usual config here
    up route add -net
    down route del

    This way, the routes are only present when the required interface is operational.

    Cheers,
    Me.

Leave a Reply

RELATED DOWNLOADS

Tiger's Storefront
Search at TigerDirect.com: