- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
01-DHCP Configuration Examples | 235 KB |
Table of Contents
Chapter 1 DHCP Functions Overview
1.2.1 Configuring the DHCP Server
1.2.2 Configuring the DHCP Relay Agent
1.2.3 Configuring DHCP Snooping
Chapter 2 Configuration Examples
2.1 DHCP Server Configuration Example
2.2 DHCP Relay Agent/Snooping Configuration Example
Keywords: DHCP, Option 82
Abstract: This document describes DHCP configuration and application on Ethernet switches in specific networking environments. Based on the different roles played by the devices in the network, the functions and applications of DHCP server, DHCP relay agent, DHCP snooping, and DHCP Option 82 are covered.
Acronym: DHCP (Dynamic Host Configuration Protocol).
Chapter 1 DHCP Functions Overview
& Note:
The configuration procedures and commands described in this manual are tested on H3C S7500 series switches running Release 3135. If you encounter any configuration failure on a device running a different release, refer to the corresponding configuration and command manuals.
1.1 Supported DHCP Functions
H3C S7500 series Ethernet switches can support the following DHCP functions:
DHCP server:
l DHCP server using global address pool/interface address pool
l IP address lease configuration
l Allocation of gateway addresses, DNS server addresses, WINS server addresses to DHCP clients
l Static bindings for special addresses
l DHCP server security functions: detection of unauthorized DHCP servers and detection of duplicate IP addresses
l DHCP self-defined options
DHCP relay agent:
l DHCP relay agent
l DHCP relay agent address check
l DHCP Option 82
DHCP snooping:
l DHCP snooping
l DHCP snooping trusted ports
l DHCP Option 82
& Note:
For details about DHCP, refer to the configuration and command manuals of S7500 series switches.
1.2 Configuration Guide
1.2.1 Configuring the DHCP Server
The DHCP server can be configured to assign IP addresses from a global or interface address pool. These two configuration methods are applicable to the following environments:
l If the DHCP server and DHCP clients are on the same network segment, both methods can be applied.
l If the DHCP server and DHCP clients are on different network segments, the DHCP server can only be configured to assign IP addresses from a global address pool.
1) Use the following commands to configure the DHCP server to assign IP addresses from a global address pool.
Table 1-1 Configure IP address allocation from a global address pool
Operation |
Command |
Description |
||
Enter system view |
system-view |
— |
||
Enable the DHCP service |
dhcp enable |
Optional By default, the DHCP service is enabled. |
||
Create a DHCP address pool and enter DHCP address pool view |
dhcp server ip-pool pool-name |
Required By default, no global DHCP address pool is created. |
||
Configure an IP address range for dynamic allocation |
network ip-address [ mask mask ] |
Required By default, no IP address range is configured for dynamic allocation. |
||
Configure the lease period of dynamically allocated IP addresses |
expired { day day [ hour hour [ minute minute ] ] | unlimited } |
Optional IP address lease period defaults to one day. |
||
Configure a domain name for DHCP clients |
domain-name domain-name |
Required By default, no domain name is configured for DHCP clients. |
||
Configure DNS server addresses for DHCP clients |
dns-list ip-address&<1-8> |
Required By default, no DNS server addresses are configured. |
||
Configure WINS server addresses for DHCP clients |
nbns-list ip-address&<1-8> |
Required By default, no WINS server addresses are configured. |
||
Specify a NetBIOS node type for DHCP clients |
netbios-type { b-node | h-node | m-node | p-node } |
Optional By default, the DHCP clients are h-nodes if the command is not specified. |
||
Configure gateway addresses for DHCP clients |
gateway-list ip-address&<1-8> |
Required By default, no gateway address is configured. |
||
Configure a self-defined DHCP option |
option code { ascii ascii-string | hex hex-string&<1-10> | ip-address ip-address&<1-8> } |
Required By default, no self-defined option is configured. |
||
Configure a static binding |
Return to system view |
quit |
Optional By default, no IP address is specified. |
|
Create an address pool for the static address binding |
dhcp server ip-pool pool-name |
|||
Specify the IP address of the static binding |
static-bind ip-address ip-address [ mask mask ] |
|||
Specify the client’s MAC address of the static binding |
static-bind mac-address mac-address |
|||
Return to system view |
quit |
— |
||
Specify the IP addresses to be excluded from automatic allocation |
dhcp server forbidden-ip low-ip-address [ high-ip-address ] |
Optional By default, all the IP addresses in a DHCP address pool are available for dynamic allocation. |
||
Configure the global address pool mode |
On the current interface |
interface interface-type interface-number |
Optional By default, an interface operates in the global address pool mode. |
|
dhcp select global |
||||
quit |
||||
On multiple interfaces in system view |
dhcp select global { interface interface-type interface-number [ to interface-type interface-number ] | all } |
|||
Enable the detection of unauthorized DHCP servers |
dhcp server detect |
Required By default, the detection of unauthorized DHCP servers is disabled. |
||
Configure duplicate IP address detection |
Set the maximum number of ping packets sent by the DHCP server for each IP address |
dhcp server ping packets number |
Optional The default maximum number is 2. |
|
Set a response timeout for each ping packet |
dhcp server ping timeout milliseconds |
Optional The default timeout is 500 milliseconds. |
||
Enable the DHCP server to support Option 82 |
dhcp server relay information enable |
Optional By default, the DHCP server supports Option 82. |
||
2) Use the following commands to configure IP address allocation through the interface address pool.
Table 1-2 Configure IP address allocation through the interface address pool
Operation |
Command |
Description |
|||
Enter system view |
system-view |
— |
|||
Enable the DHCP service |
dhcp enable |
Optional By default, the DHCP service is enabled. |
|||
Configure multiple or all the VLAN interfaces to operate in interface address pool mode |
dhcp select interface { interface interface-type interface-number [ to interface-type interface-number ] | all } |
Optional |
|||
Configure a VLAN interface to operate in interface address pool mode |
interface interface-type interface-number |
Required By default, a VLAN interface operates in global address pool mode. |
|||
dhcp select interface |
|||||
Bind an IP address statically to a client MAC address or client ID |
dhcp server static-bind ip-address ip-address mac-address mac-address |
Optional By default, no static binding is configured |
|||
Configure the lease period of dynamically allocated IP addresses |
On the current interface |
dhcp server expired { day day [ hour hour [ minute minute ] ] | unlimited } |
Optional IP address lease period defaults to one day. |
||
On multiple interfaces in system view |
quit |
||||
dhcp server expired { day day [ hour hour [ minute minute ] ] | unlimited } { interface interface-type interface-number [ to interface-type interface-number ] | all } |
|||||
Return to system view |
quit |
— |
|||
Specify the IP addresses to be excluded from automatic allocation |
dhcp server forbidden-ip low-ip-address [ high-ip-address ] |
Optional By default, all the IP addresses in an interface address pool are available for dynamic allocation. |
|||
Configure a domain name for DHCP clients |
On one interface |
interface interface-type interface-number |
Optional By default, no domain name is configured for DHCP clients. |
||
dhcp server domain-name domain-name |
|||||
quit |
|||||
On multiple interfaces |
dhcp server domain-name domain-name { interface interface-type interface-number [ to interface-type interface-number ] | all } |
||||
Configure DNS server addresses for DHCP clients |
On one interface |
interface interface-type interface-number |
Optional By default, no DNS server address is configured. |
||
dhcp server dns-list ip-address&<1-8> |
|||||
quit |
|||||
On multiple interfaces |
dhcp server dns-list ip-address&<1-8> { interface interface-type interface-number [ to interface-type interface-number ] | all } |
||||
Configure WINS server addresses for DHCP clients |
On one interface |
interface interface-type interface-number |
Optional By default, no WINS server addresses are configured. |
||
dhcp server nbns-list ip-address&<1-8> |
|||||
quit |
|||||
On multiple interfaces |
dhcp server nbns-list ip-address&<1-8> { interface interface-type interface-number [ to interface-type interface-number ] | all } |
||||
Define a NetBIOS node type for DHCP clients |
On one interface |
interface interface-type interface-number |
Optional By default, no NetBIOS node type is specified and a DHCP client uses the h-node type. |
||
dhcp server netbios-type { b-node | h-node | m-node | p-node } |
|||||
quit |
|||||
On multiple interfaces |
dhcp server netbios-type { b-node | h-node | m-node | p-node } { interface interface-type interface-number [ to interface-type interface-number ] | all } |
||||
Configure a self-defined DHCP option |
On one interface |
interface interface-type interface-number |
Optional By default, no self-defined option is configured. |
||
dhcp server option code { ascii ascii-string | hex hex-string&<1-10> | ip-address ip-address&<1-8> } |
|||||
quit |
|||||
On multiple interfaces |
dhcp server option code { ascii ascii-string | hex hex-string&<1-10> | ip-address ip-address&<1-8> } { interface interface-type interface-number [ to interface-type interface-number ] | all } |
||||
Enable the detection of unauthorized DHCP servers |
dhcp server detect |
Optional By default, the detection of unauthorized DHCP servers is disabled. |
|||
Configure duplicate IP address detection |
Set the maximum number of ping packets sent by the DHCP server for each IP address |
dhcp server ping packets number |
Optional The default maximum number is 2. |
||
Set a response timeout for each ping packet |
dhcp server ping timeout milliseconds |
Optional The default timeout is 500 milliseconds. |
|||
Enable the DHCP server to support Option 82 |
dhcp server relay information enable |
Optional By default, the DHCP server supports Option 82. |
|||
1.2.2 Configuring the DHCP Relay Agent
Use the following commands to configure the DHCP relay agent.
Table 1-3 Configure DHCP relay agent
Operation |
Command |
Description |
Enter system view |
system-view |
— |
Enable the DHCP service |
dhcp enable |
Optional By default, the DHCP service is enabled. |
Configure DHCP server IP addresses for a DHCP server group |
dhcp-server groupNo ip ip-address&<1-8> |
Required By default, no DHCP server IP address is configured for a DHCP server group. |
Configure a DHCP user address entry |
dhcp-security static ip-address mac-address |
Optional By default, no DHCP user address entry is configured. |
Enable the DHCP relay agent to support Option 82 |
dhcp relay information enable |
Required By default, the DHCP relay agent does not support Option 82. |
Configure a strategy for the DHCP relay agent to handle request packets containing Option 82 |
dhcp relay information strategy { drop | keep | replace } |
Optional By default, the strategy is replace. |
Enter VLAN interface view |
interface interface-type interface-number |
— |
Associate the interface to a DHCP server group |
dhcp-server groupNo |
Required By default, a VLAN interface is not associated to any DHCP server group. |
Enable the address check function for the DHCP relay agent |
address-check enable |
Required By default, the address check function is disabled for the DHCP relay agent. |
1.2.3 Configuring DHCP Snooping
Use the following commands to configure DHCP snooping:
Table 1-4 Configure DHCP snooping
Operation |
Command |
Description |
Enter system view |
system-view |
— |
Enable DHCP snooping |
dhcp-snooping |
Required By default, DHCP snooping is disabled. |
Enable Option 82 support on the DHCP snooping device |
dhcp-snooping information enable |
Required This function is disabled by default. |
Enter Ethernet port view |
interface interface-type interface-number |
— |
Specify the port connected to the DHCP server as a trusted port |
dhcp-snooping trust |
Optional By default, all the ports of a switch are untrusted ports. |
Chapter 2 Configuration Examples
2.1 DHCP Server Configuration Example
2.1.1 Network Requirements
An S7500 switch serves as the DHCP server in the corporate headquarters (HQ) to allocate IP addresses to the workstations in the HQ and Branch, and it also acts as the gateway to forward packets from the HQ. The network requirements are as follows:
l Connect the DHCP server to the HQ through VLAN-interface 10, and assign the IP addresses in the 10.214.10.0/24 network segment, with a lease period of two days, and exclude the IP addresses of the DNS server, WINS server, and mail server from allocation.
l Assign IP addresses to the DNS server, WINS server, and the mail server in HQ through static bindings.
l Connect the DHCP server to the public network through VLAN-interface 100, and assign the workstations in the Branch the IP addresses in the 10.210.10.0/24 network segment, with a lease period of three days. Assign the file server in the Branch an IP address through a static IP-to-MAC binding.
l Assign the addresses of the gateway, DNS server, and the WINS server along with an IP address to each workstation in the HQ and Branch.
l Enable the detection of unauthorized DHCP servers to prevent any unauthorized DHCP server from allocating invalid addresses.
2.1.2 Network Diagram
Figure 2-1 Network diagram for DHCP server configuration
2.1.3 Configuration Procedure
I. Configuring DHCP server
l Configure address allocation for the devices in the HQ.
# Configure the IP address of VLAN-interface10 on the DHCP server in the HQ.
<H3C> system-view
[H3C] interface Vlan-interface 10
[H3C-Vlan-interface10] ip address 10.214.10.1 24
# Configure the interface to operate in the interface address pool mode, assigning the IP addresses in the 10.214.10.0/24 network segment to the devices in the HQ.
[H3C-Vlan-interface10] dhcp select interface
# Configure the address lease period of the address pool, and configure the IP addresses of the DNS server and WINS server.
[H3C-Vlan-interface10] dhcp server expired day 2
[H3C-Vlan-interface10] dhcp server dns-list 10.214.10.3
[H3C-Vlan-interface10] dhcp server nbst-list 10.214.10.4
No gateway needs to be configured for the clients because an interface operating in the interface address pool mode automatically serves as the gateway for DHCP clients and sends the requested information to the clients.
# Assign IP addresses to the DNS server, WINS server, and mail server through IP-to-MAC bindings.
[H3C-Vlan-interface10] dhcp server static-bind ip-address 10.214.10.3 mac-address 000d-85c7-4e20
[H3C-Vlan-interface10] dhcp server static-bind ip-address 10.214.10.4 mac-address 0013-4ca8-9b71
[H3C-Vlan-interface10] dhcp server static-bind ip-address 10.214.10.5 mac-address 002e08d20-54c6
# Exclude the static IP addresses of the DNS server, WINS server, and mail server from allocation.
[H3C-Vlan-interface10] quit
[H3C] dhcp server forbidden-ip 10.214.10.3 10.214.10.5
l Configure address allocation for the devices in the Branch.
# Create a global address pool named “br” for the Branch, and specify the range and lease period of the IP addresses for allocation.
[H3C] dhcp server ip-pool br
[H3C-dhcp-pool-br] network 10.210.10.0 mask 255.255.255.0
[H3C-dhcp-pool-br] expired day 3
# Create a static binding address pool named “br-static”, and assign the file server in the Branch an IP address through an IP-to-MAC binding.
[H3C-dhcp-pool-br] quit
[H3C] dhcp server ip-pool br-static
[H3C-dhcp-pool-br-static] static-bind ip-address 10.214.10.4 mask 255.255.255.0
[H3C-dhcp-pool-br-static] static-bind mac-address 000d-88f8-4e71
# Specify the gateway address, DNS server address, and the WINS server address for the workstations in the Branch.
[H3C-dhcp-pool-br-static] quit
[H3C] dhcp server ip-pool br
[H3C-dhcp-pool-br] gateway-list 10.210.10.1
[H3C-dhcp-pool-br] dns-list 10.214.10.3
[H3C-dhcp-pool-br] nbst-list 10.214.10.4
# Exclude the static IP address of the gateway in the Branch from allocation.
[H3C-dhcp-pool-br] quit
[H3C] dhcp server forbidden-ip 10.210.10.1
# Enable the detection of unauthorized DHCP servers.
[H3C] dhcp server detect
# Configure VLAN-interface100 to operate in the global address pool mode.
[H3C] interface Vlan-interface 100
[H3C-Vlan-interface100] dhcp select global
Note that:
After DHCP configuration is complete, IP addresses can be assigned to the workstations in the Branch only when a route is active between the HQ and the Branch.
II. Configuring the DHCP relay agent
This section mainly describes the DHCP server configuration. The following shows the basic DHCP relay agent configuration that ensures the DHCP relay agent to relay DHCP requests to the DHCP server. For details about DHCP relay agent configuration, see section 2.2 "DHCP Relay Agent/Snooping Configuration Example".
<H3C> system-view
[H3C] dhcp-server 1 ip 10.214.10.1
[H3C] interface Vlan-interface 5
[H3C-Vlan-interface5] dhcp-server 1
2.2 DHCP Relay Agent/Snooping Configuration Example
2.2.1 Network Requirements
A Cisco Catalyst 3745 switch is deployed in the HQ and serves as the DHCP server to assign IP addresses to the workstations in the Office branch. The branches are connected to an S7506R switch that serves as the central node and as the DHCP relay agent to forward the DHCP requests from the workstations. Meanwhile, an S7502 switch that serves as the DHCP server is used to assign IP addresses to the devices in the labs. The network requirements are as follows:
l Configure the DHCP server in the HQ to assign the IP addresses in the 192.168.10.0/24 network segment to the workstations in the Office branch, with a lease period of 12 hours. Configure the IP addresses of the DNS server and WINS server as 192.169.100.2 and 192.168.100.3 respectively.
l The S7506R switch that serves as the DHCP relay agent forwards DHCP requests from the workstations in the Office and the devices in the labs. A server is deployed in the Office to provide access for hosts with manually configured IP addresses.
l An S7502 Ethernet switch in Lab1 serves as the Lab DHCP server to assign the IP addresses in the 192.168.17.0/24 network segment to the devices in Lab1, with a lease period of one day, and to assign the IP addresses in the 192.168.19.0/24 network segment to Lab2, with a lease period of two days. The lab DHCP server and the DHCP relay agent are interconnected through the 172.16.2.4/30 network segment.
l Configure the address check function on the DHCP relay agent so that only the devices that are assigned legal IP addresses from the DHCP server are allowed to access the external network.
l Enable Option 82 support on the DHCP snooping device (S7502), adding local port information to the Option 82 field in DHCP messages.
l Enable the DHCP relay agent to support DHCP Option 82 so that the DHCP relay agent keeps the original filed unchanged upon receiving DHCP messages carrying Option 82.
l Enable the DHCP server to support DHCP Option 82 so that it assigns 192.168.10.2 through 192.168.10.25 to the DHCP clients connected to Ethernet 2/0/12 of the DHCP snooping device, and assigns 192.168.10.100 through 192.168.10.110 to the DHCP clients connected to Ethernet 2/0/13 of the DHCP snooping device.
2.2.2 Network Diagram
Figure 2-2 Network diagram for DHCP relay agent/snooping integrated configuration
2.2.3 Configuration Procedure
I. Configuring the DHCP relay agent
Figure 2-3 Network diagram for DHCP relay agent configuration
# Configure to forward the DHCP requests from the Office to the DHCP server in the HQ.
<SwitchA> system-view
[SwitchA] dhcp-server 1 ip 192.168.0.3
[SwitchA] interface vlan-interface10
[SwitchA-Vlan-interface10] ip address 192.168.10.1 24
[SwitchA-Vlan-interface10] dhcp-server 1
# Configure to forward the DHCP requests from Lab2 to the Lab DHCP server.
[SwitchA-Vlan-interface10] quit
[SwitchA] dhcp-server 2 ip 192.168.17.1
[SwitchA] interface Vlan-interface 25
[SwitchA-Vlan-interface25] ip address 192.168.19.1 24
[SwitchA-Vlan-interface25] dhcp-server 2
# Configure the IP address of VLAN-interface 17 as 172.16.2.5/30 for forwarding DHCP packets from the Lab DHCP Server to a non-local segment.
[SwitchA-Vlan-interface25] quit
[SwitchA] interface Vlan-interface 17
[SwitchA-Vlan-interface17] ip address 172.16.2.5 30
# Configure the address check function on the DHCP relay agent. Make sure you configure the IP addresses and MAC addresses of the DHCP server in the lab and that in the office as static entries for the security function. The addresses of these static entries will not be checked.
[SwitchA-Vlan-interface17] quit
[SwitchA] dhcp-security static 192.168.10.3 0014-222c-aa69
[SwitchA] dhcp-security static 192.168.17.1 0010-5ce9-1dea
[SwitchA] interface Vlan-interface 10
[SwitchA-Vlan-interface10] address-check enable
[SwitchA-Vlan-interface10] quit
[SwitchA] interface vlan-interface 25
[SwitchA-Vlan-interface25] address-check enable
[SwitchA-Vlan-interface25] quit
# Enable the DHCP relay agent to support DHCP Option 82 and adopt the strategy of keeping the original filed upon receiving DHCP messages carrying Option 82.
[SwitchA] dhcp relay information enable
[SwitchA] dhcp relay information strategy keep
# To ensure normal forwarding of DHCP packets across network segments, you need configure a routing protocol and advertise the network segments of interfaces. The following configuration uses RIP as an example. For the configuration of other routing protocols, see the parts covering routing protocols in product manuals.
[SwitchA] rip
[SwitchA-rip] network 192.168.10.0
[SwitchA-rip] network 192.168.19.0
[SwitchA-rip] network 172.16.0.0
II. Configuring the Lab DHCP server
Figure 2-4 Network diagram for the Lab DHCP server configuration
# Configure an address pool for Lab2 and specify the address range, lease period, and the gateway address.
<LAB> system-view
[LAB] dhcp enable
[LAB] dhcp server ip-pool lab2
[LAB-dhcp-lab2] network 192.168.19.0 255.255.255.0
[LAB-dhcp-lab2] expired day 2
[LAB-dhcp-lab2] gateway-list 192.168.19.1
# Configure the IP address of VLAN-interface17 as 172.16.2.6/30 and enable it to operate in global address pool mode.
[LAB-dhcp-lab2] quit
[LAB] interface Vlan-interface 17
[LAB-Vlan-interface17] ip address 172.16.2.6 30
[LAB-Vlan-interface17] dhcp select global
# Lab1 is connected to VLAN-interface15. Therefore, to assign the IP addresses in the 192.168.17.0/24 network segment to the devices in Lab1, you only need to configure VLAN-interface15 to operate in the interface address pool mode.
[LAB-Vlan-interface17] quit
[LAB] interface vlan-interface 15
[LAB-Vlan-interface15] ip address 192.168.17.1 24
[LAB-Vlan-interface15] dhcp select interface
[LAB-Vlan-interface15] dhcp server expired day 1
[LAB-Vlan-interface15] quit
# To ensure that the lab DHCP server forwards DHCP packets normally, you need configure a routing protocol. The following configuration uses RIP as an example. For the configuration of other routing protocols, see the related parts in product manuals.
[LAB] rip
[LAB-rip] network 192.168.17.0
[LAB-rip] network 172.16.0.0
III. Configuring DHCP snooping
Figure 2-5 Network diagram for DHCP snooping configuration
# Enable DHCP snooping and enable Option 82 support for DHCP snooping.
<Snooping> system-view
[Snooping] dhcp-snooping
[Snooping] dhcp-snooping information enable
# Configure Ethernet 2/0/1 that connects to the DHCP server as a DHCP trusted port.
[Snooping] interface Ethernet 2/0/1
[Snooping-Ethernet2/0/1] dhcp-snooping trust
IV. Configuring the DHCP server in the HQ
# On the H3C series switches, port numbers, VLAN numbers, and the MAC addresses of the DHCP snooping device and the DHCP relay agent are added to DHCP Option 82. A complete piece of Option 82 information is a combination of the values of two suboptions:
Circuit ID suboption: It identifies the VLAN to which the clients belong and the port to which the DHCP snooping device is connected.
Figure 2-6 Packet structure of Circuit ID suboption
For example, the DHCP messages from clients connected to Ethernet 2/0/12 are added with Option 82, whose Circuit ID suboption should be 0x0106000400010011, where 01060004 is a fixed value, 0001 indicates the access port’s VLAN is VLAN 1, and 0011 is the absolute number of the port, which is less than the actual port number by 1, indicating the actual port is Ethernet 2/0/12.
Remote ID suboption: It identifies the MAC address of the DHCP snooping device connected to the client.
Figure 2-7 Packet structure of Remote ID suboption
For example, the DHCP messages from clients connected to the DHCP snooping device with MAC 000f-e234-bc66 are added with Option 82, whose Remote ID suboption should be 02080006000fe234bc66, where 02080006 is a fixed value and 000fe234bc66 is the MAC address of the DHCP snooping device.
In this example, IP addresses are assigned based on port number only. Therefore, on the DHCP server, only a matching port number field in the Circuit ID suboption needs to be found.
& Note:
The following configuration is performed on the Cisco Catalyst 3745 switch running IOS version 12.3(11)T2. If you are using any other models or devices running any other version, see the user manuals provided with the devices.
# Enable DHCP server and allocate IP addresses using Option 82 information.
Switch> enable
Switch(config)# configure terminal
Enter Configuration commands, one per line. End with CNTL/Z.
Switch(config)# service dhcp
Switch(config)# ip dhcp use class
# Create a DHCP class for the client connected to Ethernet 2/0/12 of the DHCP snooping device and match the port number in the Circuit ID suboption of Option82, and replace the contents without match need with a wildcard "*".
Switch(config)# ip dhcp class office1
Switch(dhcp-class)# relay agent information hex 0106000400010011*
Switch(dhcp-class)# exit
# Configure a DHCP class for the client connected to Etherent 2/0/13 of the DHCP snooping device and match the port number in the Circuit ID suboption of Option82.
Switch(config)# ip dhcp class office2
Switch(dhcp-class)# relay agent information hex 0106000400010012*
# Create an address pool for Office and specify address ranges for the two DHCP classes.
Switch(config)# ip dhcp pool office
Switch(dhcp-pool)# network 192.168.10.0
Switch(dhcp-pool)# class office1
Switch(dhcp-pool-class)# address range 192.168.10.2 192.168.10.25
Switch(dhcp-pool-class)# exit
Switch(dhcp-pool)# class office2
Switch(dhcp-pool-class)# address range 192.168.10.100 192.168.10.110
Switch(dhcp-pool-class)# exit
# Configure the lease period, gateway address, DNS server address, and WINS server address for the address pool.
Switch(dhcp-pool)# lease 0 12
Switch(dhcp-pool)# default-router 192.168.10.1
Switch(dhcp-pool)# dns-server 192.168.100.2
Switch(dhcp-pool)# netbios-name-server 192.168.100.3
After the above-mentioned configuration, the DHCP server can automatically assign an IP address, the gateway address, DNS server address, and the WINS server address for each device in Office.
Chapter 3 Related Documents
3.1 Protocols and Standards
l RFC2131: Dynamic Host Configuration Protocol
l RFC2132: DHCP Options and BOOTP Vendor Extensions
l RFC3046: DHCP Relay Agent Information Option