DHCP通信の詳細(パケットキャプチャ・デバッグ)

DHCP通信の詳細(パケットキャプチャ・デバッグ)

DHCP通信の詳細について、パケットキャプチャとCiscoルーターのデバッグログを確認しながら説明します。

DHCPの基礎については、下記を参照してください。

目次

ネットワーク構成

下記の4パターンで、DHCP通信の詳細を確認します。

パターンDHCPクライアントDHCPサーバー
パターン1Desktop(Linux)Ciscoルーター
パターン2CiscoルーターCiscoルーター
パターン3Desktop(Linux)Ubuntuサーバー
パターン4CiscoルーターUbuntuサーバー

DHCPサーバー、DHCPクライアントの設定方法は下記を参照してください。

【パターン1】DHCPクライアント:Desktop(Linux)、DHCPサーバー:Ciscoルーター

【パターン1】DHCPクライアント:Desktop(Linux)、DHCPサーバー:Ciscoルーター

【パターン2】DHCPクライアント:Ciscoルーター、DHCPサーバー:Ciscoルーター

【パターン2】DHCPクライアント:Ciscoルーター、DHCPサーバー:Ciscoルーター

【パターン3】DHCPクライアント:Desktop(Linux)、DHCPサーバー:Ubuntuサーバー

【パターン3】DHCPクライアント:Desktop(Linux)、DHCPサーバー:Ubuntuサーバー

【パターン4】DHCPクライアント:Ciscoルーター、DHCPサーバー:Ubuntuサーバー

【パターン4】DHCPクライアント:Ciscoルーター、DHCPサーバー:Ubuntuサーバー

DHCP通信の確認(パケットキャプチャ・デバッグ)

DHCPサーバーとなるCiscoルーターには下記のコマンドで、DHCPのデバッグを有効にします。

debug ip dhcp server events
debug ip dhcp server packet

【パターン1】DHCPクライアント:Desktop(Linux)、DHCPサーバー:Ciscoルーター

パターン1の場合の通信の詳細は下記のとおりです。DHCPサーバーからDHCPクライアントへの通信は、ユニキャスト通信が使用されています。

パターン1の通信の流れ

パケットキャプチャ確認

通信の全体の流れは下記のとおりです。DHCP Discover を受信したDHCPサーバーは、割り当て予定のIPアドレスにARP要求を送信し、応答が無いことを確認した上で DHCP Offer を送信しています。

パターン1のパケットキャプチャ
DHCP Discover の詳細
Dynamic Host Configuration Protocol (Discover)
    Message type: Boot Request (1)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x8f61f126
    Seconds elapsed: 0
    Bootp flags: 0x0000 (Unicast)
        0... .... .... .... = Broadcast flag: Unicast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 0.0.0.0
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Discover)
        Length: 1
        DHCP: Discover (1)
    Option: (61) Client identifier
        Length: 7
        Hardware type: Ethernet (0x01)
        Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Option: (57) Maximum DHCP Message Size
        Length: 2
        Maximum DHCP Message Size: 576
    Option: (55) Parameter Request List
        Length: 7
        Parameter Request List Item: (1) Subnet Mask
        Parameter Request List Item: (3) Router
        Parameter Request List Item: (6) Domain Name Server
        Parameter Request List Item: (12) Host Name
        Parameter Request List Item: (15) Domain Name
        Parameter Request List Item: (28) Broadcast Address
        Parameter Request List Item: (42) Network Time Protocol Servers
    Option: (60) Vendor class identifier
        Length: 12
        Vendor class identifier: udhcp 1.32.1
    Option: (255) End
        Option End: 255
    Padding: 0000000000000000000000000000000000000000

0… …. …. …. = Broadcast flag: Unicast
→ この部分のフラグがセットされていない場合、DHCPサーバーからの通信はユニキャストとなります。

Option: (55) Parameter Request List
→ この部分でDHCPにより要求するネットワーク情報を提示しています。

DHCP Offer の詳細
Dynamic Host Configuration Protocol (Offer)
    Message type: Boot Reply (2)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x8f61f126
    Seconds elapsed: 0
    Bootp flags: 0x0000 (Unicast)
        0... .... .... .... = Broadcast flag: Unicast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 172.16.1.1
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Offer)
        Length: 1
        DHCP: Offer (2)
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (51) IP Address Lease Time
        Length: 4
        IP Address Lease Time: (86400s) 1 day
    Option: (58) Renewal Time Value
        Length: 4
        Renewal Time Value: (43200s) 12 hours
    Option: (59) Rebinding Time Value
        Length: 4
        Rebinding Time Value: (75600s) 21 hours
    Option: (1) Subnet Mask (255.255.255.0)
        Length: 4
        Subnet Mask: 255.255.255.0
    Option: (3) Router
        Length: 4
        Router: 172.16.1.254
    Option: (6) Domain Name Server
        Length: 4
        Domain Name Server: 8.8.8.8
    Option: (255) End
        Option End: 255
    Padding: 0000000000000000000000000000

Your (client) IP address: 172.16.1.1
→ 割り当て予定のIPアドレスを通知しています。

Option: (XX)
→ その他のオプションとして割り当てる情報を通知しています。

DHCP Request の詳細
Dynamic Host Configuration Protocol (Request)
    Message type: Boot Request (1)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x8f61f126
    Seconds elapsed: 2
    Bootp flags: 0x0000 (Unicast)
        0... .... .... .... = Broadcast flag: Unicast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 0.0.0.0
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Request)
        Length: 1
        DHCP: Request (3)
    Option: (61) Client identifier
        Length: 7
        Hardware type: Ethernet (0x01)
        Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Option: (50) Requested IP Address (172.16.1.1)
        Length: 4
        Requested IP Address: 172.16.1.1
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (57) Maximum DHCP Message Size
        Length: 2
        Maximum DHCP Message Size: 576
    Option: (55) Parameter Request List
        Length: 7
        Parameter Request List Item: (1) Subnet Mask
        Parameter Request List Item: (3) Router
        Parameter Request List Item: (6) Domain Name Server
        Parameter Request List Item: (12) Host Name
        Parameter Request List Item: (15) Domain Name
        Parameter Request List Item: (28) Broadcast Address
        Parameter Request List Item: (42) Network Time Protocol Servers
    Option: (60) Vendor class identifier
        Length: 12
        Vendor class identifier: udhcp 1.32.1
    Option: (255) End
        Option End: 255
    Padding: 0000000000000000

Option: (50) Requested IP Address (172.16.1.1)
→ 通知されたIPアドレス情報の割り当てをリクエストしています。

DHCP ACK の詳細
Dynamic Host Configuration Protocol (ACK)
    Message type: Boot Reply (2)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x8f61f126
    Seconds elapsed: 0
    Bootp flags: 0x0000 (Unicast)
        0... .... .... .... = Broadcast flag: Unicast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 172.16.1.1
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (ACK)
        Length: 1
        DHCP: ACK (5)
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (51) IP Address Lease Time
        Length: 4
        IP Address Lease Time: (86400s) 1 day
    Option: (58) Renewal Time Value
        Length: 4
        Renewal Time Value: (43200s) 12 hours
    Option: (59) Rebinding Time Value
        Length: 4
        Rebinding Time Value: (75600s) 21 hours
    Option: (1) Subnet Mask (255.255.255.0)
        Length: 4
        Subnet Mask: 255.255.255.0
    Option: (3) Router
        Length: 4
        Router: 172.16.1.254
    Option: (6) Domain Name Server
        Length: 4
        Domain Name Server: 8.8.8.8
    Option: (255) End
        Option End: 255
    Padding: 0000000000000000000000000000

Option: (53) DHCP Message Type (ACK)
→ メッセージタイプ以外は、DHCP Offer と同じ情報を再送信し、ネットワーク情報の割り当てを完了します。

デバッグ確認

Router1のデバッグログで、DHCP通信の詳細が確認できます。

Router1のデバッグログ
04:11:19.785: DHCPD: Sending notification of DISCOVER:
04:11:19.786:   DHCPD: htype 1 chaddr 5254.000f.2c5a
04:11:19.786:   DHCPD: remote id 020a0000ac1001fe00000000
04:11:19.787:   DHCPD: circuit id 00000000
04:11:19.788: DHCPD: DHCPDISCOVER received from client 0152.5400.0f2c.5a on interface GigabitEthernet0/0.
04:11:19.788: DHCPD: Option 125 not present in the msg.
04:11:19.789: DHCPD: Seeing if there is an internally specified pool class:
04:11:19.789:   DHCPD: htype 1 chaddr 5254.000f.2c5a
04:11:19.790:   DHCPD: remote id 020a0000ac1001fe00000000
04:11:19.790:   DHCPD: circuit id 00000000
04:11:19.791: DHCPD: Allocate an address without class information (172.16.1.0)
04:11:19.794: DHCPD: Allocated binding E307690
04:11:19.794: DHCPD: Adding binding to radix tree (172.16.1.1)
04:11:19.795: DHCPD: Adding binding to hash tree
04:11:19.796: DHCPD: assigned IP address 172.16.1.1 to client 0152.5400.0f2c.5a.
04:11:19.796: DHCPD: Saving workspace (ID=0x15000006)
04:11:21.798: DHCPD: Reprocessing saved workspace (ID=0x15000006)
04:11:21.798: DHCPD: Option 125 not present in the msg.
04:11:21.798: DHCPD: Sending notification of DISCOVER:
04:11:21.800:   DHCPD: htype 1 chaddr 5254.000f.2c5a
04:11:21.800:   DHCPD: remote id 020a0000ac1001fe00000000
04:11:21.800:   DHCPD: circuit id 00000000
04:11:21.802: DHCPD: DHCPDISCOVER received from client 0152.5400.0f2c.5a on interface GigabitEthernet0/0.
04:11:21.802: DHCPD: Option 125 not present in the msg.
04:11:21.803: DHCPD: Seeing if there is an internally specified pool class:
04:11:21.803:   DHCPD: htype 1 chaddr 5254.000f.2c5a
04:11:21.804:   DHCPD: remote id 020a0000ac1001fe00000000
04:11:21.804:   DHCPD: circuit id 00000000
04:11:21.805: DHCPD: Sending DHCPOFFER to client 0152.5400.0f2c.5a (172.16.1.1).DHCPD: Setting only requested parameters
04:11:21.807: DHCPD: Option 125 not present in the msg.
04:11:21.807: DHCPD: no option 125
04:11:21.807: DHCPD: src nbma addr as zero
04:11:21.807: DHCPD: creating ARP entry (172.16.1.1, 5254.000f.2c5a, vrf default).
04:11:21.808: DHCPD: unicasting BOOTREPLY to client 5254.000f.2c5a (172.16.1.1).
04:11:21.824: DHCPD: New packet workspace 0xD0F1738 (ID=0x30000007)
04:11:21.824: DHCPD: client's VPN is .
04:11:21.826: DHCPD: No option 125
04:11:21.826: DHCPD: DHCPREQUEST received from client 0152.5400.0f2c.5a.
04:11:21.827: DHCPD: Option 125 not present in the msg.
04:11:21.827: DHCPD: Sending notification of ASSIGNMENT:
04:11:21.828:  DHCPD: address 172.16.1.1 mask 255.255.255.0
04:11:21.828:   DHCPD: htype 1 chaddr 5254.000f.2c5a
04:11:21.829:   DHCPD: lease time remaining (secs) = 86400
04:11:21.829: DHCPD: Can't find any hostname to update
04:11:21.830: DHCPD: Sending DHCPACK to client 0152.5400.0f2c.5a (172.16.1.1).DHCPD: Setting only requested parameters

【パターン2】DHCPクライアント:Ciscoルーター、DHCPサーバー:Ciscoルーター

パターン2の場合の通信の詳細は下記のとおりです。DHCPサーバーからDHCPクライアントへの通信は、ブロードキャスト通信が使用されています。

パターン2の通信の流れ

パケットキャプチャ確認

通信の全体の流れは下記のとおりです。DHCP Discover を受信したDHCPサーバーは、割り当て予定のIPアドレスにARP要求を送信し、応答が無いことを確認した上で DHCP Offer を送信しています。

パターン2のパケットキャプチャ
DHCP Discover の詳細
Dynamic Host Configuration Protocol (Discover)
    Message type: Boot Request (1)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x00001559
    Seconds elapsed: 0
    Bootp flags: 0x8000, Broadcast flag (Broadcast)
        1... .... .... .... = Broadcast flag: Broadcast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 0.0.0.0
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_17:89:b3 (52:54:00:17:89:b3)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Discover)
        Length: 1
        DHCP: Discover (1)
    Option: (57) Maximum DHCP Message Size
        Length: 2
        Maximum DHCP Message Size: 1200
    Option: (61) Client identifier
        Length: 27
        Type: 0
        Client Identifier: cisco-5254.0017.89b3-Gi0/0
    Option: (12) Host Name
        Length: 7
        Host Name: Router2
    Option: (55) Parameter Request List
        Length: 8
        Parameter Request List Item: (1) Subnet Mask
        Parameter Request List Item: (6) Domain Name Server
        Parameter Request List Item: (15) Domain Name
        Parameter Request List Item: (44) NetBIOS over TCP/IP Name Server
        Parameter Request List Item: (3) Router
        Parameter Request List Item: (33) Static Route
        Parameter Request List Item: (150) TFTP Server Address
        Parameter Request List Item: (43) Vendor-Specific Information
    Option: (60) Vendor class identifier
        Length: 8
        Vendor class identifier: ciscopnp
    Option: (255) End
        Option End: 255

1… …. …. …. = Broadcast flag: Broadcast
→ この部分のフラグがセットされている場合、DHCPサーバーからの通信はブロードキャストとなります。

Option: (55) Parameter Request List
→ この部分でDHCPにより要求するネットワーク情報を提示しています。

DHCP Offer の詳細
Dynamic Host Configuration Protocol (Offer)
    Message type: Boot Reply (2)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x00001559
    Seconds elapsed: 0
    Bootp flags: 0x8000, Broadcast flag (Broadcast)
        1... .... .... .... = Broadcast flag: Broadcast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 172.16.1.1
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_17:89:b3 (52:54:00:17:89:b3)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Offer)
        Length: 1
        DHCP: Offer (2)
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (51) IP Address Lease Time
        Length: 4
        IP Address Lease Time: (86400s) 1 day
    Option: (58) Renewal Time Value
        Length: 4
        Renewal Time Value: (43200s) 12 hours
    Option: (59) Rebinding Time Value
        Length: 4
        Rebinding Time Value: (75600s) 21 hours
    Option: (1) Subnet Mask (255.255.255.0)
        Length: 4
        Subnet Mask: 255.255.255.0
    Option: (3) Router
        Length: 4
        Router: 172.16.1.254
    Option: (6) Domain Name Server
        Length: 4
        Domain Name Server: 8.8.8.8
    Option: (255) End
        Option End: 255
    Padding: 0000000000000000000000000000

Your (client) IP address: 172.16.1.1
→ 割り当て予定のIPアドレスを通知しています。

Option: (XX)
→ その他のオプションとして割り当てる情報を通知しています。

DHCP Request の詳細
Dynamic Host Configuration Protocol (Request)
    Message type: Boot Request (1)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x00001559
    Seconds elapsed: 0
    Bootp flags: 0x8000, Broadcast flag (Broadcast)
        1... .... .... .... = Broadcast flag: Broadcast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 0.0.0.0
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_17:89:b3 (52:54:00:17:89:b3)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Request)
        Length: 1
        DHCP: Request (3)
    Option: (57) Maximum DHCP Message Size
        Length: 2
        Maximum DHCP Message Size: 1200
    Option: (61) Client identifier
        Length: 27
        Type: 0
        Client Identifier: cisco-5254.0017.89b3-Gi0/0
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (50) Requested IP Address (172.16.1.1)
        Length: 4
        Requested IP Address: 172.16.1.1
    Option: (12) Host Name
        Length: 7
        Host Name: Router2
    Option: (55) Parameter Request List
        Length: 8
        Parameter Request List Item: (1) Subnet Mask
        Parameter Request List Item: (6) Domain Name Server
        Parameter Request List Item: (15) Domain Name
        Parameter Request List Item: (44) NetBIOS over TCP/IP Name Server
        Parameter Request List Item: (3) Router
        Parameter Request List Item: (33) Static Route
        Parameter Request List Item: (150) TFTP Server Address
        Parameter Request List Item: (43) Vendor-Specific Information
    Option: (60) Vendor class identifier
        Length: 8
        Vendor class identifier: ciscopnp
    Option: (255) End
        Option End: 255

Option: (50) Requested IP Address (172.16.1.1)
→ 通知されたIPアドレス情報の割り当てをリクエストしています。

DHCP ACK の詳細
Dynamic Host Configuration Protocol (ACK)
    Message type: Boot Reply (2)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x00001559
    Seconds elapsed: 0
    Bootp flags: 0x8000, Broadcast flag (Broadcast)
        1... .... .... .... = Broadcast flag: Broadcast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 172.16.1.1
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_17:89:b3 (52:54:00:17:89:b3)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (ACK)
        Length: 1
        DHCP: ACK (5)
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (51) IP Address Lease Time
        Length: 4
        IP Address Lease Time: (86400s) 1 day
    Option: (58) Renewal Time Value
        Length: 4
        Renewal Time Value: (43200s) 12 hours
    Option: (59) Rebinding Time Value
        Length: 4
        Rebinding Time Value: (75600s) 21 hours
    Option: (1) Subnet Mask (255.255.255.0)
        Length: 4
        Subnet Mask: 255.255.255.0
    Option: (3) Router
        Length: 4
        Router: 172.16.1.254
    Option: (6) Domain Name Server
        Length: 4
        Domain Name Server: 8.8.8.8
    Option: (255) End
        Option End: 255
    Padding: 0000000000000000000000000000

Option: (53) DHCP Message Type (ACK)
→ メッセージタイプ以外は、DHCP Offer と同じ情報を再送信し、ネットワーク情報の割り当てを完了します。

デバッグ確認

Router1のデバッグログで、DHCP通信の詳細が確認できます。

Router1のデバッグログ
04:47:36.918: DHCPD: DHCPDISCOVER received from client 0063.6973.636f.2d35.3235.342e.3030.3137.2e38.3962.332d.4769.302f.30 on interface GigabitEthernet0/0.
04:47:36.918: DHCPD: Option 125 not present in the msg.
04:47:36.919: DHCPD: Seeing if there is an internally specified pool class:
04:47:36.920:   DHCPD: htype 1 chaddr 5254.0017.89b3
04:47:36.920:   DHCPD: remote id 020a0000ac1001fe00000000
04:47:36.920:   DHCPD: circuit id 00000000
04:47:36.921: DHCPD: Allocate an address without class information (172.16.1.0)
04:47:36.925: DHCPD: Allocated binding 109AFD38
04:47:36.925: DHCPD: Adding binding to radix tree (172.16.1.1)
04:47:36.926: DHCPD: Adding binding to hash tree
04:47:36.926: DHCPD: assigned IP address 172.16.1.1 to client 0063.6973.636f.2d35.3235.342e.3030.3137.2e38.3962.332d.4769.302f.30.
04:47:36.927: DHCPD: Saving workspace (ID=0x4A00000A)
04:47:38.925: DHCPD: Reprocessing saved workspace (ID=0x4A00000A)
04:47:38.925: DHCPD: Option 125 not present in the msg.
04:47:38.926: DHCPD: Sending notification of DISCOVER:
04:47:38.926:   DHCPD: htype 1 chaddr 5254.0017.89b3
04:47:38.926:   DHCPD: remote id 020a0000ac1001fe00000000
04:47:38.927:   DHCPD: circuit id 00000000
04:47:38.927: DHCPD: DHCPDISCOVER received from client 0063.6973.636f.2d35.3235.342e.3030.3137.2e38.3962.332d.4769.302f.30 on interface GigabitEthernet0/0.
04:47:38.928: DHCPD: Option 125 not present in the msg.
04:47:38.928: DHCPD: Seeing if there is an internally specified pool class:
04:47:38.928:   DHCPD: htype 1 chaddr 5254.0017.89b3
04:47:38.929:   DHCPD: remote id 020a0000ac1001fe00000000
04:47:38.929:   DHCPD: circuit id 00000000
04:47:38.930: DHCPD: Sending DHCPOFFER to client 0063.6973.636f.2d35.3235.342e.3030.3137.2e38.3962.332d.4769.302f.30 (172.16.1.1).DHCPD: Setting only requested parameters
04:47:38.931: DHCPD: Option 125 not present in the msg.
04:47:38.932: DHCPD: no option 125
04:47:38.932: DHCPD: broadcasting BOOTREPLY to client 5254.0017.89b3.
04:47:38.934: DHCPD: New packet workspace 0xEE83C80 (ID=0xEC00000B)
04:47:38.935: DHCPD: client's VPN is .
04:47:38.935: DHCPD: No option 125
04:47:38.936: DHCPD: DHCPREQUEST received from client 0063.6973.636f.2d35.3235.342e.3030.3137.2e38.3962.332d.4769.302f.30.
04:47:38.936: DHCPD: Option 125 not present in the msg.
04:47:38.936: DHCPD: Sending notification of ASSIGNMENT:
04:47:38.938:  DHCPD: address 172.16.1.1 mask 255.255.255.0
04:47:38.938:   DHCPD: htype 1 chaddr 5254.0017.89b3
04:47:38.939:   DHCPD: lease time remaining (secs) = 86400
04:47:38.939: DHCPD: No default domain to append - abort update
04:47:38.939: DHCPD: Sending DHCPACK to client 0063.6973.636f.2d35.3235.342e.3030.3137.2e38.3962.332d.4769.302f.30 (172.16.1.1).DHCPD: Setting only requested parameters

【パターン3】DHCPクライアント:Desktop(Linux)、DHCPサーバー:Ubuntuサーバー

パターン3の場合の通信の詳細は下記のとおりです。DHCPサーバーからDHCPクライアントへの通信は、ユニキャスト通信が使用されています。

パターン3の通信の流れ

パケットキャプチャ確認

通信の全体の流れは下記のとおりです。DHCP Discover を受信したDHCPサーバーは、割り当て予定のIPアドレスにARP要求を送信し、応答が無いことを確認した上で DHCP Offer を送信しています。

パターン3のパケットキャプチャ
DHCP Discover の詳細
Dynamic Host Configuration Protocol (Discover)
    Message type: Boot Request (1)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x89b5a445
    Seconds elapsed: 0
    Bootp flags: 0x0000 (Unicast)
        0... .... .... .... = Broadcast flag: Unicast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 0.0.0.0
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Discover)
        Length: 1
        DHCP: Discover (1)
    Option: (61) Client identifier
        Length: 7
        Hardware type: Ethernet (0x01)
        Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Option: (57) Maximum DHCP Message Size
        Length: 2
        Maximum DHCP Message Size: 576
    Option: (55) Parameter Request List
        Length: 7
        Parameter Request List Item: (1) Subnet Mask
        Parameter Request List Item: (3) Router
        Parameter Request List Item: (6) Domain Name Server
        Parameter Request List Item: (12) Host Name
        Parameter Request List Item: (15) Domain Name
        Parameter Request List Item: (28) Broadcast Address
        Parameter Request List Item: (42) Network Time Protocol Servers
    Option: (60) Vendor class identifier
        Length: 12
        Vendor class identifier: udhcp 1.32.1
    Option: (255) End
        Option End: 255
    Padding: 0000000000000000000000000000000000000000

0… …. …. …. = Broadcast flag: Unicast
→ この部分のフラグがセットされていない場合、DHCPサーバーからの通信はユニキャストとなります。

Option: (55) Parameter Request List
→ この部分でDHCPにより要求するネットワーク情報を提示しています。

DHCP Offer の詳細
Dynamic Host Configuration Protocol (Offer)
    Message type: Boot Reply (2)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x89b5a445
    Seconds elapsed: 0
    Bootp flags: 0x0000 (Unicast)
        0... .... .... .... = Broadcast flag: Unicast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 172.16.1.1
    Next server IP address: 172.16.1.254
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Offer)
        Length: 1
        DHCP: Offer (2)
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (51) IP Address Lease Time
        Length: 4
        IP Address Lease Time: (600s) 10 minutes
    Option: (1) Subnet Mask (255.255.255.0)
        Length: 4
        Subnet Mask: 255.255.255.0
    Option: (3) Router
        Length: 4
        Router: 172.16.1.254
    Option: (6) Domain Name Server
        Length: 4
        Domain Name Server: 8.8.8.8
    Option: (15) Domain Name
        Length: 11
        Domain Name: example.org
    Option: (255) End
        Option End: 255
    Padding: 00000000000000000000000000

Your (client) IP address: 172.16.1.1
→ 割り当て予定のIPアドレスを通知しています。

Option: (XX)
→ その他のオプションとして割り当てる情報を通知しています。

DHCP Request の詳細
Dynamic Host Configuration Protocol (Request)
    Message type: Boot Request (1)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x89b5a445
    Seconds elapsed: 1
    Bootp flags: 0x0000 (Unicast)
        0... .... .... .... = Broadcast flag: Unicast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 0.0.0.0
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Request)
        Length: 1
        DHCP: Request (3)
    Option: (61) Client identifier
        Length: 7
        Hardware type: Ethernet (0x01)
        Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Option: (50) Requested IP Address (172.16.1.1)
        Length: 4
        Requested IP Address: 172.16.1.1
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (57) Maximum DHCP Message Size
        Length: 2
        Maximum DHCP Message Size: 576
    Option: (55) Parameter Request List
        Length: 7
        Parameter Request List Item: (1) Subnet Mask
        Parameter Request List Item: (3) Router
        Parameter Request List Item: (6) Domain Name Server
        Parameter Request List Item: (12) Host Name
        Parameter Request List Item: (15) Domain Name
        Parameter Request List Item: (28) Broadcast Address
        Parameter Request List Item: (42) Network Time Protocol Servers
    Option: (60) Vendor class identifier
        Length: 12
        Vendor class identifier: udhcp 1.32.1
    Option: (255) End
        Option End: 255
    Padding: 0000000000000000

Option: (50) Requested IP Address (172.16.1.1)
→ 通知されたIPアドレス情報の割り当てをリクエストしています。

DHCP ACK の詳細
Dynamic Host Configuration Protocol (ACK)
    Message type: Boot Reply (2)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x89b5a445
    Seconds elapsed: 1
    Bootp flags: 0x0000 (Unicast)
        0... .... .... .... = Broadcast flag: Unicast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 172.16.1.1
    Next server IP address: 172.16.1.254
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_0f:2c:5a (52:54:00:0f:2c:5a)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (ACK)
        Length: 1
        DHCP: ACK (5)
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (51) IP Address Lease Time
        Length: 4
        IP Address Lease Time: (600s) 10 minutes
    Option: (1) Subnet Mask (255.255.255.0)
        Length: 4
        Subnet Mask: 255.255.255.0
    Option: (3) Router
        Length: 4
        Router: 172.16.1.254
    Option: (6) Domain Name Server
        Length: 4
        Domain Name Server: 8.8.8.8
    Option: (15) Domain Name
        Length: 11
        Domain Name: example.org
    Option: (255) End
        Option End: 255
    Padding: 00000000000000000000000000

Option: (53) DHCP Message Type (ACK)
→ メッセージタイプ以外は、DHCP Offer と同じ情報を再送信し、ネットワーク情報の割り当てを完了します。

【パターン4】DHCPクライアント:Ciscoルーター、DHCPサーバー:Ubuntuサーバー

パターン4の場合の通信の詳細は下記のとおりです。DHCPサーバーからDHCPクライアントへの通信は、ブロードキャスト通信が使用されています。

パターン4の通信の流れ

パケットキャプチャ確認

通信の全体の流れは下記のとおりです。DHCP Discover を受信したDHCPサーバーは、割り当て予定のIPアドレスにARP要求を送信し、応答が無いことを確認した上で DHCP Offer を送信しています。

パターン4のパケットキャプチャ
DHCP Discover の詳細
Dynamic Host Configuration Protocol (Discover)
    Message type: Boot Request (1)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x00001d42
    Seconds elapsed: 0
    Bootp flags: 0x8000, Broadcast flag (Broadcast)
        1... .... .... .... = Broadcast flag: Broadcast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 0.0.0.0
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_17:89:b3 (52:54:00:17:89:b3)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Discover)
        Length: 1
        DHCP: Discover (1)
    Option: (57) Maximum DHCP Message Size
        Length: 2
        Maximum DHCP Message Size: 1200
    Option: (61) Client identifier
        Length: 27
        Type: 0
        Client Identifier: cisco-5254.0017.89b3-Gi0/0
    Option: (12) Host Name
        Length: 7
        Host Name: Router1
    Option: (55) Parameter Request List
        Length: 8
        Parameter Request List Item: (1) Subnet Mask
        Parameter Request List Item: (6) Domain Name Server
        Parameter Request List Item: (15) Domain Name
        Parameter Request List Item: (44) NetBIOS over TCP/IP Name Server
        Parameter Request List Item: (3) Router
        Parameter Request List Item: (33) Static Route
        Parameter Request List Item: (150) TFTP Server Address
        Parameter Request List Item: (43) Vendor-Specific Information
    Option: (60) Vendor class identifier
        Length: 8
        Vendor class identifier: ciscopnp
    Option: (255) End
        Option End: 255

1… …. …. …. = Broadcast flag: Broadcast
→ この部分のフラグがセットされている場合、DHCPサーバーからの通信はブロードキャストとなります。

Option: (55) Parameter Request List
→ この部分でDHCPにより要求するネットワーク情報を提示しています。

DHCP Offer の詳細
Dynamic Host Configuration Protocol (Offer)
    Message type: Boot Reply (2)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x00001d42
    Seconds elapsed: 0
    Bootp flags: 0x8000, Broadcast flag (Broadcast)
        1... .... .... .... = Broadcast flag: Broadcast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 172.16.1.1
    Next server IP address: 172.16.1.254
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_17:89:b3 (52:54:00:17:89:b3)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Offer)
        Length: 1
        DHCP: Offer (2)
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (51) IP Address Lease Time
        Length: 4
        IP Address Lease Time: (600s) 10 minutes
    Option: (1) Subnet Mask (255.255.255.0)
        Length: 4
        Subnet Mask: 255.255.255.0
    Option: (6) Domain Name Server
        Length: 4
        Domain Name Server: 8.8.8.8
    Option: (15) Domain Name
        Length: 11
        Domain Name: example.org
    Option: (3) Router
        Length: 4
        Router: 172.16.1.254
    Option: (255) End
        Option End: 255
    Padding: 00000000000000000000000000

Your (client) IP address: 172.16.1.1
→ 割り当て予定のIPアドレスを通知しています。

Option: (XX)
→ その他のオプションとして割り当てる情報を通知しています。

DHCP Request の詳細
Dynamic Host Configuration Protocol (Request)
    Message type: Boot Request (1)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x00001d42
    Seconds elapsed: 0
    Bootp flags: 0x8000, Broadcast flag (Broadcast)
        1... .... .... .... = Broadcast flag: Broadcast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 0.0.0.0
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_17:89:b3 (52:54:00:17:89:b3)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (Request)
        Length: 1
        DHCP: Request (3)
    Option: (57) Maximum DHCP Message Size
        Length: 2
        Maximum DHCP Message Size: 1200
    Option: (61) Client identifier
        Length: 27
        Type: 0
        Client Identifier: cisco-5254.0017.89b3-Gi0/0
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (50) Requested IP Address (172.16.1.1)
        Length: 4
        Requested IP Address: 172.16.1.1
    Option: (12) Host Name
        Length: 7
        Host Name: Router1
    Option: (55) Parameter Request List
        Length: 8
        Parameter Request List Item: (1) Subnet Mask
        Parameter Request List Item: (6) Domain Name Server
        Parameter Request List Item: (15) Domain Name
        Parameter Request List Item: (44) NetBIOS over TCP/IP Name Server
        Parameter Request List Item: (3) Router
        Parameter Request List Item: (33) Static Route
        Parameter Request List Item: (150) TFTP Server Address
        Parameter Request List Item: (43) Vendor-Specific Information
    Option: (60) Vendor class identifier
        Length: 8
        Vendor class identifier: ciscopnp
    Option: (255) End
        Option End: 255

Option: (50) Requested IP Address (172.16.1.1)
→ 通知されたIPアドレス情報の割り当てをリクエストしています。

DHCP ACK の詳細
Dynamic Host Configuration Protocol (ACK)
    Message type: Boot Reply (2)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x00001d42
    Seconds elapsed: 0
    Bootp flags: 0x8000, Broadcast flag (Broadcast)
        1... .... .... .... = Broadcast flag: Broadcast
        .000 0000 0000 0000 = Reserved flags: 0x0000
    Client IP address: 0.0.0.0
    Your (client) IP address: 172.16.1.1
    Next server IP address: 172.16.1.254
    Relay agent IP address: 0.0.0.0
    Client MAC address: RealtekU_17:89:b3 (52:54:00:17:89:b3)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (ACK)
        Length: 1
        DHCP: ACK (5)
    Option: (54) DHCP Server Identifier (172.16.1.254)
        Length: 4
        DHCP Server Identifier: 172.16.1.254
    Option: (51) IP Address Lease Time
        Length: 4
        IP Address Lease Time: (600s) 10 minutes
    Option: (1) Subnet Mask (255.255.255.0)
        Length: 4
        Subnet Mask: 255.255.255.0
    Option: (6) Domain Name Server
        Length: 4
        Domain Name Server: 8.8.8.8
    Option: (15) Domain Name
        Length: 11
        Domain Name: example.org
    Option: (3) Router
        Length: 4
        Router: 172.16.1.254
    Option: (255) End
        Option End: 255
    Padding: 00000000000000000000000000

Option: (53) DHCP Message Type (ACK)
→ メッセージタイプ以外は、DHCP Offer と同じ情報を再送信し、ネットワーク情報の割り当てを完了します。

【参考】割り当て予定のIPアドレスのARP情報を保持している場合

Ping(ICMP)による未割り当て確認

サーバーのDHCPサービスが再起動した場合など、DHCP割り当て予定のIPアドレスのARP情報を既に保持している場合は、ARPではなくPing(ICMP)による未割り当て確認が行われます。

パケットキャプチャ

Ping(ICMP)による未割り当て確認が行われた場合の通信の流れは下記のとおりです。

以上で、DHCP通信の詳細(パケットキャプチャ・デバッグ)の説明は完了です!

DHCPリレーエージェントを経由する場合のDHCP通信の詳細は、下記を参照してください。

  • URLをコピーしました!
  • URLをコピーしました!
目次