Monday, December 7, 2009

Buat Start up Debian

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.

No comments: