Verifying the configuration, Self-defined option configuration example, Network requirements – H3C Technologies H3C S12500 Series Switches User Manual

Page 67

Advertising
background image

53

# Enable the DHCP server on VLAN-interface 1 and VLAN-interface 2.

[SwitchA] interface vlan-interface 1

[SwitchA-Vlan-interface1] dhcp select server global-pool

[SwitchA-Vlan-interface1] quit

[SwitchA] interface vlan-interface 2

[SwitchA-Vlan-interface2] dhcp select server global-pool

[SwitchA-Vlan-interface2] quit

# Exclude IP addresses (addresses of the DNS server, WINS server, and gateways).

[SwitchA] dhcp server forbidden-ip 10.1.1.2

[SwitchA] dhcp server forbidden-ip 10.1.1.4

[SwitchA] dhcp server forbidden-ip 10.1.1.126

[SwitchA] dhcp server forbidden-ip 10.1.1.254

# Configure DHCP address pool 0 (network segment, client domain name suffix, and DNS server
address).

[SwitchA] dhcp server ip-pool 0

[SwitchA-dhcp-pool-0] network 10.1.1.0 mask 255.255.255.0

[SwitchA-dhcp-pool-0] domain-name aabbcc.com

[SwitchA-dhcp-pool-0] dns-list 10.1.1.2

[SwitchA-dhcp-pool-0] quit

# Configure DHCP address pool 1 (network segment, gateway, lease duration, and WINS

server).

[SwitchA] dhcp server ip-pool 1

[SwitchA-dhcp-pool-1] network 10.1.1.0 mask 255.255.255.128

[SwitchA-dhcp-pool-1] gateway-list 10.1.1.126

[SwitchA-dhcp-pool-1] expired day 10 hour 12

[SwitchA-dhcp-pool-1] nbns-list 10.1.1.4

[SwitchA-dhcp-pool-1] quit

# Configure DHCP address pool 2 (network segment, gateway, and lease duration).

[SwitchA] dhcp server ip-pool 2

[SwitchA-dhcp-pool-2] network 10.1.1.128 mask 255.255.255.128

[SwitchA-dhcp-pool-2] expired day 5

[SwitchA-dhcp-pool-2] gateway-list 10.1.1.254

Verifying the configuration

After the preceding configuration is complete, clients on networks 10.1.1.0/25 and 10.1.1.128/25 can

obtain IP addresses on the corresponding network and other network parameters from Switch A. You can

use the display dhcp server ip-in-use command on the DHCP server to view the IP addresses assigned to
the clients.

Self-defined option configuration example

Network requirements

As shown in

Figure 29

, the DHCP client (Switch B) obtains an IP address and PXE server addresses from

the DHCP server (Switch A). The IP address that Switch B obtains belongs to subnet 10.1.1.0/24. The PXE

server addresses are 1.2.3.4 and 2.2.2.2.
The DHCP server assigns PXE server addresses to DHCP clients through Option 43, a self-defined option.
The format of Option 43 and that of the PXE server address list are shown in

Figure 17

and

Figure 19

,

Advertising