33.2.3 Setting to distribute static IP to clients
- Points to note
-
The example below shows how to distribute static IP addresses to DHCP clients and pair the IP addresses with the corresponding MAC addresses.
Figure 33-2: Client-server configuration (when a fixed IP is distributed)
Command examples
-
(config)# interface vlan 10
(config-if)# ip address 10.1.11.1 255.255.255.0
(config-if)# exit
Sets the necessary VLAN interface and IP address in advance.
-
(config)# service dhcp vlan 10
Specifies the name of the VLAN interface on which the DHCP server is enabled.
-
(config)# ip dhcp pool Client1
Sets the name of the DHCP address pool for DHCP client A.
Switches to DHCP configuration mode.
-
(dhcp-config)# host 10.1.11.50 255.255.255.0
Sets a static IP address for DHCP client A in the DHCP address pool.
-
(dhcp-config)# hardware-address 0012.e2ef.1111 ethernet
Sets the MAC address for DHCP client A in the DHCP address pool.
-
(dhcp-config)# default-router 10.1.11.1
(dhcp-config)# exit
Sets the IP address of the router on the subnet.
-
(config)# ip dhcp pool Client2
(dhcp-config)# host 10.1.11.100 255.255.255.0
(dhcp-config)# hardware-address 0012.e2ef.2222 ethernet
(dhcp-config)# default-router 10.1.11.1
Repeats steps 3 through 6 to set the name of the DHCP address pool for DHCP client B, and to set a static IP address and MAC address for DHCP client B in the Client2 DHCP address pool.