We know that DHCP configurations on switches and routers are very common. So how should I use the DHCP function of the PC instead of the DHCP function of the switch? Next we will take a detailed look at the process of configuring the DHCP server of the switch.
1. Configure the vswitch DHCP server:
Ip dhcp-server 192.168.0.69
2. Set the IP address of the same DHCP server for each VLAN in the vswitch:
Interface Vlan11
Ip address 192.168.1.254 255.255.255.0
Ip helper-address 192.168.0.69 DHCP Server IP
Interface Vlan12
Ip address 192.168.2.254 255.255.255.0
Ip helper-address 192.168.0.69 DHCP Server IP
3. to configure the DHCP server of A vswitch, you need to set the network address ranges of 192.168.1.0 and 192.168.2.0 respectively on the vswitch.
Set the "option" to the interface IP address of the corresponding VLAN.
2. Use the DHCP function provided by the layer-3 Switch to automatically allocate IP addresses in multiple VLANs
1. Allocate addresses for multiple VLAN clients at the same time
2. Some IP addresses in a VLAN are manually allocated.
3. Specify the gateway and Wins server for the customer
4. The IP address lease term for VLAN 2 is one day, and the other is three days.
5. assign a specified IP address to a specific user based on the MAC address
Finally, the DHCP server of the vswitch is configured as follows:
Ip dhcp excluded-address 10.1.1.1 10.1.1.19 // address not used for Dynamic address Allocation
Ip dhcp excluded-address 10.1.1.240 10.1.1.254
Ip dhcp excluded-address 10.1.2.1 10.1.2.19
!
Ip dhcp pool global // global is the pool name, which is specified by the user
Network 10.1.0.0 255.255.0.0 // dynamically assigned address segment
Domain-name client.com // configure the domain suffix for the client
Dns-server 10.1.1.1 10.1.1.2 // configure the dns server for the client
Netbios-name-server 10.1.1.5 10.1.1.6 // configure the wins server for the client
Netbios-node-type h-node
// Configuring the node mode for the client affects the smoothness of name interpretation. For example, h-node = is explained first through the wins server ...)
Lease 3 // address lease period: 3 days
Ip dhcp pool vlan1
Network 10.1.1.0 255.255.255.0
// This pool is a global sub-pool and will inherit domain-name from the global pool.
Option
Default-router 10.1.1.100 10.1.1.101 // configure the default gateway for the client
!
Ip dhcp pool vlan2 // pool configured for another VLAN
Network 10.1.2.0 255.255.255.255.0
Default-router 10.1.2.100 10.1.2.101
Lease 1
!
Ip dhcp pool vlanw.john // always allocates a... address for the host whose MAC address is...
Host 10.1.1.21 255.255.255.0
Client-identifier 010050. bade.6384 // client-identifier = 01 with the client NIC address
!
Ip dhcp pool vlan1_tom
Host 10.1.1.50 255.255.255.0
Client-identifier 010010.3ab1.eac8
Related configuration switch DHCP server and Debugging commands:
No service dhcp // stop the DHCP service [DHCP service is enabled by default]
Sh ip dhcp binding // displays Address allocation information
Show ip dhcp conflict // display address conflict
Debug ip dhcp server {events | packets | linkage}
// Observe the working status of the DHCP server
If the DHCP client is not assigned an IP address, there are two common causes. The first case is that the port connecting to the client is not set
Portfast mode. After the MS Client is started, it checks that the network card is connected normally and the Link is UP. Then, it starts to send the DHCPDISCOVER request.
The switch port is undergoing Spanning Tree computing. Generally, it takes 30-50 seconds to enter the forwarding status. The MS client does not receive the dhcp server's
In response, a 169.169.X.X IP address is set for the NIC. The solution is to set the vswitch port to Portfast:
CatOS (4000/5000/6000): set spantree portfast mod_num/port_num enable;
IOS (2900/3500): interface...; spanning-tree portfast