On Sun, 09 Mar 2008, in the Usenet newsgroup comp.os.linux.networking, in
article <(E-Mail Removed)>, Joseph Hesse wrote:
>I know ifconfig will set the network interfaces but it is not permanent.
>As far as I know I could:
>
>1. Put the ifconfig command in /etc/rc.d/rc.local to make it permanent.
>or
>2. I could hand edit the file /etc/sysconfig/network-scripts/ifcfg-eth0.
>
>Are there other ways or is the above the best?
http://www.pathname.com/fhs/
/etc/sysconfig/network and /etc/sysconfig/network-scripts/ has been a
Red Hat "standard" that has been adopted by a number of distributions
that are based on (or were influenced by) Red Hat. It's not the only way
to do things. Certainly, other distributions may do things quite
differently. rc.local is a locally administered "catch-all" boot
script, normally used for "local" tweaks to the system, or tasks
not covered by other boot scripts.
As a _general_ statement, it's _USUALLY_ a good idea to stick with the
ideas that the distribution uses. In that way, you won't be surprised
when encountering another system that uses these configurations by
default. However, nothing prevents you from doing as you wish.
While you could put the ifconfig command in /etc/rc.d/rc.local, that
file is the last of the boot scripts to run (probably called as
/etc/rc.d/rc3.d/S99local), compared to the "normal" network
configuration file (perhaps /etc/rc.d/rc3.d/S10network), and there may
well be other boot scripts (such as S11firewall, S11portmap, S50inet,
S60nfs, S80sendmail and similar) that depend on the network being up,
but are called before the rc.local is run. (Init scripts in the run-level
directories are run in the order the links are shown by the 'ls' command.)
Use the command 'rpm -qd sysvinit' to find the documentation that comes
with the sysvinit (System V Init) package. While somewhat old, you
should also have a look through the From-PowerUp-To-Bash-Prompt-HOWTO
which may be hidden in /usr/share/HOWTO on your system (or use your
favorite search engine to find it):
-rw-rw-r-- 1 gferg ldp 43309 Nov 5 2000 From-PowerUp-To-Bash-Prompt-HOWTO
Section 6 of the HOWTO discusses the System V Init process, though it
doesn't get into the network configuration files.
Another document to look at is "Introduction to Linux - A Hands on Guide"
from the Linux Documentation Project (
http://tldp.org/guides.html).
Section 10 discusses network configuration. That site also has a
"Linux Filesystem Hierarchy" guide that provides additional help with
the 'fhs' referred to above.
Old guy