dhcp の変更点   

  • 追加された行はこの色です。
  • 削除された行はこの色です。
  • dhcp へ行く。

* 勝手にIP を割り振ってくれるツール DHCP [#b9a23fcd]

** install [#u44a047c]
ない場合は yum あるいは apt-get で入れる~
version 3 以上にはいろいろ機能が追加されているので~
なるべくをれらを使う~

# yum install dhcp

# emacs /etc/dhcpd.conf
 ddns-update-style none;                        # ver3 以上必須
 log-facility local1;                           # log を messages から分離
  
 authoritative;                                 # IE のプロキシ自動設定用
 option wpad code 252 = string;                 #
 option wpad "http://wpad.hoge.com/wpad.dat";   # 
  
 option domain-name "domain.com";               # ドメイン名の設定
 option domain-name-servers xxx.xxx.xxx.xxx;    # DNSサーバのIPアドレス
 subnet 192.168.0.0 netmask 255.255.255.0 {     # ネットワークアドレス
    default-lease-time 600;                     # 標準のIPアドレス貸し出し時間(単位:秒)
    max-lease-time 7200;           # 最大のIPアドレス貸し出し時間(単位:秒)
    option routers 192.168.0.1;    # デフォルトゲートウェイのIPアドレス 
    option broadcast-address 192.168.0.255;     # ブロードキャストアドレス
    option subnet-mask 255.255.255.0;        # サブネットマスク
 
    ### 任意の範囲のIPアドレス割り当て ###
    range 192.168.0.100 192.168.0.200;        # 割り当てるIPアドレスの範囲
 
    ### 固定IPアドレスの割り当て ###
 #    host heze {                             # ホスト名
 #      hardware ethernet 00:07:40:0F:2F:AB;  # MACアドレス
 #      option routers 192.168.0.1;           # デフォルトゲートウェイ
 #      fixed-address  192.168.0.2;           # 割り当てるIPアドレス
 #    }
 }

# emacs /etc/rc.d/init.d/dhcpd
  # chkconfig: 345 65 35

# chkconfig dhcpd on
# /etc/rc.d/init.d/dhcpd start

# emacs /etc/syslog.conf
 local1.*                       /var/log/dhcpd.log

 *.info;local1.none             messages ←追加

 /etc/rc.d/init.d/syslog restart
 /etc/rc.d/init.d/dhcpd restart

* dhclient [#z6fcb4e6]
DHCP環境で固定IPをリクエストする方法~
/etc/dhclient.conf
 interface "eth0" {
 send dhcp-requested-address 192.168.0.100;
 }

 # dhclient -cf /etc/dhclient.conf


----

参考:
 http://www.linux.or.jp/JM/html/sysklogd/man5/syslog.conf.5.html
*** memo [#rb098140]
syslog から分離する際にファシリティとして local1 を使ったが、これは~
あいているID をしようすればよい~
local0〜local9 が使える。~