Project

General

Profile

Actions

CiscoでDHCPクライアントかつ固定IPアドレスを割り振る場合の設定

注意

…繰り返すが、CiscoデバイスをDHCP クライアント 、かつ 固定でIPアドレスを割り振る場合 の話である。DHCPサーバにする際の注意事項は今までも散々言われていることなので、多くは書かない。

サーバ側の設定

……多くは書かない。機材はCisco1812J。

ip dhcp excluded-address 10.0.125.1 10.0.125.2
!
ip dhcp pool VLAN-32-dynamic
 network 10.0.125.0 255.255.255.0
 domain-name local
!
ip dhcp pool VLAN-32-static
 host 10.0.125.3 255.255.255.0
 client-identifier 0100.14a8.2012.0a
 domain-name local
 client-name c1760
 lease infinite
!

読めばわかると思うが、一応。

  • IPアドレスブロックは10.0.125.0/24。
  • うち、固定のIPアドレスを割り当てるのはMACアドレス00:14:A8:20:12:0Aをもつネットワークインタフェイスであり(client-identifierオプションの使い方に注意)、10.0.125.3が割り振られる。

クライアント側の設定

実はこちらが原因でうまく動かなかった。機材はCisco1760。

interface FastEthernet0/0
 ip address dhcp client-id FastEthernet0/0 hostname c1760
 speed auto
!

ポイントはclient-idを指定すること。hostnameだけではダメ。

サーバ側のログ(成功した場合)

クライアント/サーバ双方の設定が問題なければ、予定通りのIPアドレスが割り振られる。

Aug 26 15:09:16.995: DHCPD: client's VPN is .
Aug 26 15:09:16.995: DHCPD: No option 125
Aug 26 15:09:16.999: DHCPD: Sending notification of DISCOVER:
Aug 26 15:09:16.999:   DHCPD: htype 1 chaddr 0014.a820.120a
Aug 26 15:09:16.999:   DHCPD: remote id 020a00000a007d0108000020
Aug 26 15:09:16.999:   DHCPD: circuit id 00000000
Aug 26 15:09:16.999: DHCPD: DHCPDISCOVER received from client 0100.14a8.2012.0a on interface Vlan32.
Aug 26 15:09:16.999: DHCPD: Seeing if there is an internally specified pool class:
Aug 26 15:09:16.999:   DHCPD: htype 1 chaddr 0014.a820.120a
Aug 26 15:09:16.999:   DHCPD: remote id 020a00000a007d0108000020
Aug 26 15:09:16.999:   DHCPD: circuit id 00000000
Aug 26 15:09:16.999: DHCPD: Found Manual/Static binding
Aug 26 15:09:16.999: DHCPD: Sending DHCPOFFER to client 0100.14a8.2012.0a (10.0.125.3).
Aug 26 15:09:16.999: DHCPD: child  pool: 10.0.125.3 / 255.255.255.0 (VLAN-32-static)
Aug 26 15:09:16.999: DHCPD: parent pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:16.999: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:16.999: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:09:16.999: DHCPD: child  pool: 10.0.125.3 / 255.255.255.0 (VLAN-32-static)
Aug 26 15:09:16.999: DHCPD: parent pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:16.999: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:16.999: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:09:16.999: DHCPD: child  pool: 10.0.125.3 / 255.255.255.0 (VLAN-32-static)
Aug 26 15:09:16.999: DHCPD: parent pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:16.999: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:16.999: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:09:16.999: DHCPD: no option 125
Aug 26 15:09:16.999: DHCPD: broadcasting BOOTREPLY to client 0014.a820.120a.
Aug 26 15:09:17.003: DHCPD: client's VPN is .
Aug 26 15:09:17.003: DHCPD: No option 125
Aug 26 15:09:17.003: DHCPD: DHCPREQUEST received from client 0100.14a8.2012.0a.
Aug 26 15:09:17.003: DHCPD: Sending notification of ASSIGNMENT:
Aug 26 15:09:17.003:  DHCPD: address 10.0.125.3 mask 255.255.255.0
Aug 26 15:09:17.003:   DHCPD: htype 1 chaddr 0014.a820.120a
Aug 26 15:09:17.003:   DHCPD: lease time remaining (secs) = 4294967295
Aug 26 15:09:17.003: DHCPD: Appending default domain from pool
Aug 26 15:09:17.003: DHCPD: Using hostname 'c1760.local.' for dynamic update (from hostname option)
Aug 26 15:09:17.003: DHCPD: Sending DHCPACK to client 0100.14a8.2012.0a (10.0.125.3).
Aug 26 15:09:17.003: DHCPD: child  pool: 10.0.125.3 / 255.255.255.0 (VLAN-32-static)
Aug 26 15:09:17.003: DHCPD: parent pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:17.003: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:17.003: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:09:17.003: DHCPD: child  pool: 10.0.125.3 / 255.255.255.0 (VLAN-32-static)
Aug 26 15:09:17.003: DHCPD: parent pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:17.003: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:17.003: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:09:17.007: DHCPD: child  pool: 10.0.125.3 / 255.255.255.0 (VLAN-32-static)
Aug 26 15:09:17.007: DHCPD: parent pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:17.007: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:09:17.007: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:09:17.007: DHCPD: no option 125
Aug 26 15:09:17.007: DHCPD: broadcasting BOOTREPLY to client 0014.a820.120a.

サーバ側のログ(失敗した場合)

client-idを忘れると…………こうなるorz

Aug 26 15:34:34.608: DHCPD: client's VPN is .
Aug 26 15:34:34.608: DHCPD: No option 125
Aug 26 15:34:34.608: DHCPD: DHCPREQUEST received from client 012c.4138.8759.c5.
Aug 26 15:34:34.608: DHCPD: Finding a relay for client 012c.4138.8759.c5 on interface Vlan1.
Aug 26 15:34:34.608: DHCPD: Seeing if there is an internally specified pool class:
Aug 26 15:34:34.608:   DHCPD: htype 1 chaddr 2c41.3887.59c5
Aug 26 15:34:34.608:   DHCPD: remote id 020a00000a0079fe02000001
Aug 26 15:34:34.608:   DHCPD: circuit id 00000000
Aug 26 15:34:45.688: DHCPD: client's VPN is .
Aug 26 15:34:45.688: DHCPD: No option 125
Aug 26 15:34:45.688: DHCPD: DHCPRELEASE message received from client 0100.14a8.2012.0a (10.0.125.3).
Aug 26 15:34:45.688: DHCPD: Finding a relay for client 0100.14a8.2012.0a on interface Vlan32.
Aug 26 15:34:45.688: DHCPD: Seeing if there is an internally specified pool class:
Aug 26 15:34:45.688:   DHCPD: htype 1 chaddr 0014.a820.120a
Aug 26 15:34:45.688:   DHCPD: remote id 020a00000a007d0108000020
Aug 26 15:34:45.688:   DHCPD: circuit id 00000000
Aug 26 15:34:47.688: DHCPD: client's VPN is .
Aug 26 15:34:47.692: DHCPD: No option 125
Aug 26 15:34:47.692: DHCPD: DHCPRELEASE message received from client 0100.14a8.2012.0a (10.0.125.3).
Aug 26 15:34:47.692: DHCPD: Finding a relay for client 0100.14a8.2012.0a on interface Vlan32.
Aug 26 15:34:47.692: DHCPD: Seeing if there is an internally specified pool class:
Aug 26 15:34:47.692:   DHCPD: htype 1 chaddr 0014.a820.120a
Aug 26 15:34:47.692:   DHCPD: remote id 020a00000a007d0108000020
Aug 26 15:34:47.692:   DHCPD: circuit id 00000000
Aug 26 15:34:50.140: DHCPD: client's VPN is .
Aug 26 15:34:50.140: DHCPD: No option 125
Aug 26 15:34:50.140: DHCPD: Sending notification of DISCOVER:
Aug 26 15:34:50.140:   DHCPD: htype 1 chaddr 0014.a820.120a
Aug 26 15:34:50.140:   DHCPD: remote id 020a00000a007d0108000020
Aug 26 15:34:50.140:   DHCPD: circuit id 00000000
Aug 26 15:34:50.140: DHCPD: DHCPDISCOVER received from client 0063.6973.636f.2d30.3031.342e.6138.3230.2e31.3230.612d.4661.302f.30 on interface Vlan32.
Aug 26 15:34:50.140: DHCPD: Seeing if there is an internally specified pool class:
Aug 26 15:34:50.140:   DHCPD: htype 1 chaddr 0014.a820.120a
Aug 26 15:34:50.140:   DHCPD: remote id 020a00000a007d0108000020
Aug 26 15:34:50.140:   DHCPD: circuit id 00000000
Aug 26 15:34:50.140: DHCPD: Allocate an address without class information (10.0.125.0)
Aug 26 15:34:50.140: DHCPD: Adding binding to radix tree (10.0.125.10)
Aug 26 15:34:50.140: DHCPD: Adding binding to hash tree
Aug 26 15:34:50.144: DHCPD: assigned IP address 10.0.125.10 to client 0063.6973.636f.2d30.3031.342e.6138.3230.2e31.3230.612d.4661.302f.30.
Aug 26 15:34:50.144: DHCPD: Saving workspace (ID=0x6F00002C)
Aug 26 15:34:52.140: DHCPD: Reprocessing saved workspace (ID=0x6F00002C)
Aug 26 15:34:52.140: DHCPD: Sending notification of DISCOVER:
Aug 26 15:34:52.140:   DHCPD: htype 1 chaddr 0014.a820.120a
Aug 26 15:34:52.140:   DHCPD: remote id 020a00000a007d0108000020
Aug 26 15:34:52.140:   DHCPD: circuit id 00000000
Aug 26 15:34:52.140: DHCPD: DHCPDISCOVER received from client 0063.6973.636f.2d30.3031.342e.6138.3230.2e31.3230.612d.4661.302f.30 on interface Vlan32.
Aug 26 15:34:52.140: DHCPD: Seeing if there is an internally specified pool class:
Aug 26 15:34:52.140:   DHCPD: htype 1 chaddr 0014.a820.120a
Aug 26 15:34:52.140:   DHCPD: remote id 020a00000a007d0108000020
Aug 26 15:34:52.140:   DHCPD: circuit id 00000000
Aug 26 15:34:52.140: DHCPD: Found previous server binding
Aug 26 15:34:52.140: DHCPD: Sending DHCPOFFER to client 0063.6973.636f.2d30.3031.342e.6138.3230.2e31.3230.612d.4661.302f.30 (10.0.125.10).
Aug 26 15:34:52.140: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:34:52.140: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:34:52.140: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:34:52.140: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:34:52.140: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:34:52.140: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:34:52.140: DHCPD: no option 125
Aug 26 15:34:52.140: DHCPD: broadcasting BOOTREPLY to client 0014.a820.120a.
Aug 26 15:34:52.144: DHCPD: client's VPN is .
Aug 26 15:34:52.144: DHCPD: No option 125
Aug 26 15:34:52.144: DHCPD: DHCPREQUEST received from client 0063.6973.636f.2d30.3031.342e.6138.3230.2e31.3230.612d.4661.302f.30.
Aug 26 15:34:52.144: DHCPD: Sending notification of ASSIGNMENT:
Aug 26 15:34:52.144:  DHCPD: address 10.0.125.10 mask 255.255.255.0
Aug 26 15:34:52.144:   DHCPD: htype 1 chaddr 0014.a820.120a
Aug 26 15:34:52.144:   DHCPD: lease time remaining (secs) = 86400
Aug 26 15:34:52.144: DHCPD: Appending default domain from pool
Aug 26 15:34:52.144: DHCPD: Using hostname 'c1760.local.' for dynamic update (from hostname option)
Aug 26 15:34:52.144: DHCPD: Sending DHCPACK to client 0063.6973.636f.2d30.3031.342e.6138.3230.2e31.3230.612d.4661.302f.30 (10.0.125.10).
Aug 26 15:34:52.144: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:34:52.144: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:34:52.144: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:34:52.144: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:34:52.144: DHCPD: child  pool: 10.0.125.0 / 255.255.255.0 (VLAN-32-dynamic)
Aug 26 15:34:52.144: DHCPD: pool VLAN-32-dynamic has no parent.
Aug 26 15:34:52.144: DHCPD: no option 125
Aug 26 15:34:52.144: DHCPD: broadcasting BOOTREPLY to client 0014.a820.120a.

Updated by Tsutomu KIMURA almost 11 years ago · 2 revisions locked