LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   add some command when booting (https://www.linuxquestions.org/questions/linux-general-1/add-some-command-when-booting-224563/)

blackzone 08-30-2004 09:07 PM

add some command when booting
 
I would like to add the following two commands during booting:

ifconfig eth0 192.168.0.12
route add default gw 192.168.0.1

Where can I add it?
==================================================

I tried putting it in .bashrc but the problem is .bashrc reruns everytime when you open a terminal window.

And "route add default gw 192.168.0.1" will display a warning if default route already setup.

So I have to either add the two commends in booting or in the .bashrc find if the file already exist ... Which file does it store when running "route add default gw 192.168.0.1"?

Tinkster 08-30-2004 09:43 PM

What distro are you using, why don't you use the
distribution-provided methods for bringing up the
ethernet interfaces ... ?


Cheers,
Tink

blackzone 08-30-2004 10:09 PM

redhat 9.0

isn't there a common way to add it?
like add those 2 line to somewhere in the bootu process that would work for all distro?

Netizen 08-30-2004 10:20 PM

Quote:

Originally posted by blackzone
redhat 9.0

isn't there a common way to add it?
like add those 2 line to somewhere in the bootu process that would work for all distro?

You would think that. All distros are common yet uncommon.

In slack you could add commands in the /etc/rc.d/rc.local file. I don't think that file exists in Red hat.

Tinkster 08-30-2004 10:25 PM

RH does have a rc.local ...
but really it's a system service that should be
set-up using either RH tools or at least in
/etc/sysconfig/network ...


Cheers,
Tink


All times are GMT -5. The time now is 01:57 PM.