dhcpd failover 設定
- プライマリ・サーバ
- OS: FreeBSD-5.3R
- dhcpd: isc-dhcp3-server-3.0.3
- ip addr: 192.168.1.254
- セカンダリ・サーバ
- OS: FreeBSD-5.4R
- dhcpd: isc-dhcp3-server-3.0.3
- ip addr: 192.168.1.198
手順としては、
- dhcp failover に関する部分を dhcpd.conf に設定
- 共通部分については、dhcpd.master に設定
- dhcpd.conf の最後で dhcpd.master を読み込む.
dhcpd.conf プライマリ側の設定
- failover peer 宣言
- primary/secondary
- 自分のアドレスとポート(address,port)
- 相手のアドレスとポート(peer address,peer port)
- Maximum Client Lead Time(mclt) は プライマリ側のみ指定
- split 128 は 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と同義
# dhcpd.conf for primary failover peer "hoge" { primary; address 192.168.1.254; port 10001; peer address 192.168.1.198; peer port 10001; max-response-delay 60; max-unacked-updates 10; mclt 3600; split 128; load balance max seconds 3; } include "/usr/local/etc/dhcpd.master";
dhcpd.conf セカンダリ側の設定
# dhcpd.conf for secondary failover peer "hoge" { secondary; address 192.168.1.198; port 10001; peer address 192.168.1.254; peer port 10001; max-response-delay 60; max-unacked-updates 10; } include "/usr/local/etc/dhcpd.master";
dhcpd.master の設定例
- pool 宣言ごとに failover peer を設定する
- "dynamic bootp are not compatible with failover." とのことなので deny する
- range 項目は、pool 宣言の中に入れるべきか、出すべきかわからなかったが、ぐぐるで見つかった方々の設定は入れていたので、中へ入れた.
# dhcpd.master global parameter ... subnet 192.168.1.0 netmask 255.255.255.0 { option parameter ... pool { failover peer "hoge"; range 192.168.1.1 192.168.1.191; deny dynamic bootp clients; } }
実際にはうちの dhcpd.master は以下のように
をしていたり、アドレスのリース時間がとても長かったりしています.
# dhcpd.master authoritative; option domain-name "example.co.jp"; option domain-name-servers a.ns. example.co.jp; option subnet-mask 255.255.255.0; ### wins conf ## use wins server option netbios-name-servers wins.example.co.jp; option netbios-node-type 8; #Hybrid Type ### wpad conf option wpad code 252 = string; ddns-update-style none; one-lease-per-client true; default-lease-time 43200; max-lease-time 86400; ### subnet 192.168.1.0 subnet 192.168.1.0 netmask 255.255.255.0 { option routers gate.example.co.jp; option broadcast-address 192.168.1.255; option wpad "http://wpad.example.co.jp/proxy.pac"; pool { failover peer "hoge"; range 192.168.1.1 192.168.1.191; deny dynamic bootp clients; } }
リファレンス:
DHCP Failover/load balancing
http://www.lithodyne.net/docs/dhcp/dhcp.html
DHCP Manual Pages (Client & Server)
http://www.bind9.net/manuals-dhcp
freshports - net/isc-dhcp3-server
http://www.freshports.org/net/isc-dhcp3-server/
自分メモ:
DHCP failover その2
http://taizooo.g.hatena.ne.jp/taizooo/20051003
DHCP failover
http://taizooo.g.hatena.ne.jp/taizooo/20050906