HYLOGICS

今後は各分室にコンテンツを移して、ここは雑記や暮らしを中心としたライフログ的な何かにしていく予定です。

network-scriptsの書き方

こういう記事が流れてきたので書いておく。

network-scriptsはinitscriptsパッケージに含まれている。

# rpm -qf /etc/sysconfig/network-scripts/
initscripts-9.03.49-1.el6.centos.2.x86_64
Installed Packages
Name        : initscripts
Arch        : x86_64
Version     : 9.03.49
Release     : 1.el6.centos.2
Size        : 5.5 M
Repo        : installed
From repo   : updates
Summary     : The inittab file and the /etc/init.d scripts
URL         : http://fedorahosted.org/releases/i/n/initscripts/
License     : GPLv2 and GPLv2+
Description : The initscripts package contains the basic system scripts used to
            : boot your Red Hat or Fedora system, change runlevels, and shut the
            : system down cleanly.  Initscripts also contains the scripts that
            : activate and deactivate most network interfaces.

このinitscriptsだがmanを見てもnetwork-scriptsの書式についてのドキュメントがない。 ではドキュメントはないのかというとそんなことはなくて、実は下記に配置されている。

/usr/share/doc/initscripts-*/sysconfig.txt

/etc/sysconfig/network-scripts/ifcfg-<interface-name> and
/etc/sysconfig/network-scripts/ifcfg-<interface-name>:<alias-name>:

  The first defines an interface, and the second contains
  only the parts of the definition that are different in a
  "alias" (or alternative) interface.  For example, the
  network numbers might be different, but everything else
  might be the same, so only the network numbers would be
  in the alias file, but all the device information would
  be in the base ifcfg file.

  The items that can be defined in an ifcfg file depend on the
  interface type.  The really obvious ones I'm not going to
  bother to define; you can figure out what "IPADDR" is, I
  think...  :-)

結構長いので詳細は割愛しますが、正しく設定したいのであれば目を通しておくことをオススメします。