玄箱/dhcp
出典: Fukudat.com
< 玄箱
目次 |
1 インストール
- apt でインストール
apt-get install dhcp3-common dhcp3-server
2 設定
3個設定ファイルを作成する.それぞれの内容は後述.
- /etc/dhcp3/dhcpd.master (共通の設定)
- /etc/dhcp3/dhcpd.primary (プライマリサーバーの設定)
- /etc/dhcp3/dhcpd.secondary (セカンダリサーバーの設定)
プライマリサーバーでは,/etc/dhcp3/dhcpd.primary を /etc/dhcp3/dhcpd.conf にシンボリックリンクする.
cd /etc/dhcp3; ln -s dhcpd.primary dhcpd.conf
セカンダリサーバーでは,/etc/dhcp3/dhcpd.secondary を /etc/dhcp3/dhcpd.conf にシンボリックリンクする.
cd /etc/dhcp3; ln -s dhcpd.secandary dhcpd.conf
2.1 dhcpd.master
以下の内容で /etc/dhcp3/dhcpd.master を作成する
option domain-name "fukudat.com";
option domain-name-servers 192.168.0.11, 192.168.0.12;
default-lease-time 3600;
max-lease-time 86400;
ddns-update-style interim;
ddns-domainname "fukudat.com";
ddns-rev-domainname "in-addr.arpa";
subnet 192.168.0.0 netmask 255.255.255.0 {
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
pool {
failover peer "test";
deny dynamic bootp clients;
range 192.168.0.100 192.168.0.250;
}
host chiori {
hardware ethernet 00:0e:a6:17:5d:34;
fixed-address crew.fukudat.com;
}
host crew {
hardware ethernet 00:30:1b:b9:19:dd;
fixed-address crew.fukudat.com;
}
}
authoritative;
log-facility local7;
2.2 dhcpd.primary
以下の内容で /etc/dhcp3/dhcpd.primary を作成する.
failover peer "test" {
primary;
address 192.168.0.11;
port 10001;
peer address 192.168.0.12;
peer port 10001;
max-response-delay 60;
max-unacked-updates 10;
mclt 3600;
hba ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:
00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00;
load balance max seconds 3;
}
include "/etc/dhcp3/dhcpd.master";
2.3 dhcpd.secondary
以下の内容で /etc/dhcp3/dhcpd.secondary を作成する.
failover peer "test" {
primary;
address 192.168.0.12;
port 10001;
peer address 192.168.0.11;
peer port 10001;
max-response-delay 60;
max-unacked-updates 10;
}
include "/etc/dhcp3/dhcpd.master";
