各種ネットワーク設定

ホスト名

/etc/hostnameに書く

NIC設定

auto lo eth0 #auto on

iface lo inet loopback #loopback

iface eth0 inet static #static
  address 192.168.1.1
  netmask 255.255.255.0
  gateway 192.168.1.254

iface eth0:0 inet static #alias
  address 192.168.1.2
  netmask 255.255.255.0

iface eth1 inet dhcp #DHCP 

インターフェイス起動順序

インターフェイス起動の実行順序

  1. /etc/network/interface内のpre-upコマンド
  2. /etc/network/if-pre-up.d/内のスクリプト
  3. インターフェイスUP
  4. /etc/network/interface内のupコマンド
  5. /etc/network/if-up.d/内のスクリプト

インターフェイス終了の実行順序

  1. /etc/interface内のdownコマンド
  2. /etc/network/if-down.d/内のスクリプト
  3. インターフェイスDown
  4. /etc/interface内のpost-downコマンド
  5. /etc/netowrk/if-post-down.d/内のスクリプト

iptablesの配置場所

iptablesのスクリプトを作成したら、以下の様に配置するといいだろう

起動

/etc/netwrok/interfaceのpre-upコマンド、/etc/network/if-pre-up.d/の中

停止

/etc/interface内のpost-downコマンド、/etc/network/if-post-up.d/の中

お勧めは/etc/netowrk/if-pre.d,if-post.d/。

DNS

/etc/resolv.conf

nameserver IP
domain x.x.x #属するドメイン名
search #ホスト名検索用
option
       timeout:n #timeout値
       attempts:n #問い合わせ回数

検索順序

/etc/nsswitch.conf

hosts:          files dns

file(/etc/hosts) -> dnsとういう順序になる


debian Valid HTML 4.01 Strict [VALID RSS!]