CAT724_dhcpサーバ

CAT724をdhcpサーバにする方法

debianには各種dhcpサーバがありますが一番シンプルな udhcp (マイクロdhcp)をインストールします。udhcp は busybox内蔵の dhcpサーバを起動するスクリプトと設定ファイルです。

展開

fileudhcpd_sh4.tgz

をダウンロードして /tmp に置く

展開する

# rommode rw
# cd /
# tar xzvf /tmp/udhcpd_sh4.tgz
etc/udhcpd.conf
etc/default/udhcpd
etc/init.d/udhcpd
etc/rc2.d/S02udhcpd
usr/sbin/udhcpd
usr/bin/dumpleases

自動起動設定

/etc/init.d/.depend.start を vi エディタで編集する

  • TARGETS = の最後に udhcpd を追加する
  • udhcpd: rsyslog を追加する(場所はどこでもよい)
  • /etc/init.d/.depend.start 編集後の例
TARGETS = bootlogs killprocs single portmap nfs-common rsyslog openbsd-inetd cron ssh rc.local rmnologin stop-bootlogd udhcpd
INTERACTIVE =
single: killprocs bootlogs
openbsd-inetd: rsyslog
cron: rsyslog
ssh: rsyslog
udhcpd: rsyslog
rc.local: rsyslog portmap nfs-common openbsd-inetd bootlogs cron ssh
rmnologin: portmap nfs-common openbsd-inetd rsyslog bootlogs cron ssh
stop-bootlogd: portmap nfs-common openbsd-inetd rsyslog bootlogs cron ssh

設定

CAT724自身の eth0 アドレスを固定にする。この例では 192.168.0.1

  • /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
       address 192.168.0.1
       netmask 255.255.255.0
       gateway 192.168.0.1
  • /etc/default/udhcpd
# Comment the following line to enable
DHCPD_ENABLED="yes"                ここを "no" にすると起動しない
  • /etc/udhcpd.conf
start           192.168.0.20    #default: 192.168.0.20    配布アドレスの開始
end             192.168.0.254   #default: 192.168.0.254   配布アドレスの終わり

#Examles
opt     dns     192.168.10.2 192.168.10.10                配布するdhcサーバアドレス
option  subnet  255.255.255.0                             配布するサブネット
opt     router  192.168.10.2                              配布するゲートウェイアドレス
opt     wins    192.168.10.10
option  dns     129.219.13.81   # appened to above DNS servers for a total of 3
option  domain  local
option  lease   864000          # 10 days of seconds

関連

Last-modified: 2017-05-18 (木) 17:28:18 (2535d)