ラベル IP Service の投稿を表示しています。 すべての投稿を表示
ラベル IP Service の投稿を表示しています。 すべての投稿を表示

2012年1月3日火曜日

no ip dhcp conflict logging


IOS で DHCP サーバ機能を利用し database agent 機能を利用しない場合は
「no ip dhcp conflict logging」設定をすることが推奨とされているが、理由が分からなかったので調べてみた。

  • Cisco.comより

strongly recommend using database agents. However, the Cisco IOS server can run without them. If you choose not to configure a DHCP database agent, disable the recording of DHCP address conflicts on the DHCP server by using the no ip dhcp conflict logging command in global configuration mode.
If there is conflict logging but no database agent configured, bindings are lost across router reboots.
Possible false conflicts can occur causing the address to be removed from the address pool until the network administrator intervenes.

http://www.cisco.com/en/US/docs/ios/ipaddr/configuration/guide/iad_dhcp_svr_cfg_ps6441_TSD_Products_Configuration_Guide_Chapter.html#wp1027188

  • 実機確認


「no ip dhcp conflict logging」設定をしていないルータが再起動した場合
→IP割り当ての情報(show ip dhcp binding)が消える
→既に割り当て済みのIPを払いだそうとする
※DHCP Server側でもpingによるIP重複検出を実施しているようだが応答があるまえにDHCP offer を出してしまっている
→PCがGARPによりIP重複を確認し、DHCP Declineを返す
→show ip dhcp conflict に登録される
→show ip dhcp conflict に登録されたIPはプールとして利用されなくなる(「ip dhcp exclude-address」に登録したような状態)
→プールアドレスが減る
→再び利用するには手動でのオペレーションが必要(方法は要確認)

ということで、「no ip dhcp conflict logging」を設定しておければ conflict として登録されないのでプールアドレスが減ってIP割り当てができなくなることはないということのようだ

※DHCP database agent機能を利用し、割り当て管理を行う方法が最も推奨

2011年12月28日水曜日

DHCP relay

DHCPメッセージが relay agent を経由した場合、どのように変わるか確認

1.relay agent - client間

DHCP Discover: 0.0.0.0 → 255.255.255.255
DHCP Offer: 192.168.2.254 → 255.255.255.255
DHCP Request: 0.0.0.0 → 255.255.255.255
DHCP ACK: 192.168.2.254 → 255.255.255.255
IP重複確認?のためclientからGARP

※relay agent ip addressは0.0.0.0

R2#debug ip dhcp server packet
R2#
*Mar 1 00:03:11.219: DHCPD: setting giaddr to 192.168.2.254.
*Mar 1 00:03:11.227: DHCPD: BOOTREQUEST from 0063.6973.636f.2d63.3230.322e.3339.3063.2e30.3030.302d.4661.302f.30 forwarded to 192.168.12.1.
R2#
*Mar 1 00:03:14.279: DHCPD: setting giaddr to 192.168.2.254.
*Mar 1 00:03:14.283: DHCPD: BOOTREQUEST from 0063.6973.636f.2d63.3230.322e.3339.3063.2e30.3030.302d.4661.302f.30 forwarded to 192.168.12.1.
R2#
*Mar 1 00:03:16.431: DHCPD: forwarding BOOTREPLY to client c202.390c.0000.
*Mar 1 00:03:16.435: DHCPD: broadcasting BOOTREPLY to client c202.390c.0000.
*Mar 1 00:03:16.535: DHCPD: Finding a relay for client 0063.6973.636f.2d63.3230.322e.3339.3063.2e30.3030.302d.4661.302f.30 on interface FastEthernet0/0.
*Mar 1 00:03:16.539: DHCPD: setting giaddr to 192.168.2.254.
*Mar 1 00:03:16.543: DHCPD: BOOTREQUEST from 0063.6973.636f.2d63.3230.322e.3339.3063.2e30.3030.302d.4661.302f.30 forwarded to 192.168.12.1.
*Mar 1 00:03:16.631: DHCPD: forwarding BOOTREPLY to client c202.390c.0000.
*Mar 1 00:03:16.631: DHCPD: broadcasting BOOTREPLY to client c202.390c.0000.


2.server - relay agent間

DHCP Discover: 192.168.2.254 → 192.168.12.1
DHCP Offer: 192.168.12.1 → 192.168.2.254
DHCP Request: 192.168.2.254 → 192.168.12.1
DHCP ACK: 192.168.12.1 → 192.168.2.254

※relay agent ip addressに192.168.2.254がセットされている


R1#debug ip dhcp server packet
R1#
*Mar 1 00:09:52.043: DHCPD: DHCPDISCOVER received from client 0063.6973.636f.2d63.3230.322e.3339.3063.2e30.3030.302d.4661.302f.30 through relay 192.168.2.254.
*Mar 1 00:09:52.047: DHCPD: Allocate an address without class information (192.168.2.0)
R1#
*Mar 1 00:09:54.051: DHCPD: Sending DHCPOFFER to client 0063.6973.636f.2d63.3230.322e.3339.3063.2e30.3030.302d.4661.302f.30 (192.168.2.2).
*Mar 1 00:09:54.055: DHCPD: unicasting BOOTREPLY for client c202.390c.0000 to relay 192.168.2.254.
*Mar 1 00:09:54.235: DHCPD: DHCPREQUEST received from client 0063.6973.636f.2d63.3230.322e.3339.3063.2e30.3030.302d.4661.302f.30.
*Mar 1 00:09:54.239: DHCPD: No default domain to append - abort update
*Mar 1 00:09:54.243: DHCPD: Sending DHCPACK to client 0063.6973.636f.2d63.3230.322e.3339.3063.2e30.3030.302d.4661.302f.30 (192.168.2.2).
*Mar 1 00:09:54.247: DHCPD: unicasting BOOTREPLY for client c202.390c.0000 to relay 192.168.2.254.
R1#

★注意事項
relay agent ip は ip helper-addressを設定したインタフェースのIPとなる
→DHCPサーバ側にrelay agent ip へのルートが確保されている必要がある