We usually use DHCP servers through routers and switches. Here we will learn about setting up DHCP server instances on the Cisco650 device. A customer wants to migrate the dhcp server to the msfc of the 6509 switch. Don't use tears to touch love. The requirements are quite complicated:
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
The final configuration is 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 // configure the node mode for the client to affect the smooth interpretation of the name, for example, h-node = explain through the wins server first ...)
- 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. Why can't we afford it? We will inherit domain-name and other options from the global pool.
- 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 DHCP 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 to Portfast. After the MS Client is started, it checks that the network adapter is connected normally. When the Link is UP, it starts to send the DHCPDISCOVER request. At this time, the switch port is undergoing Spanning Tree computing and generally takes 30-50 seconds to enter the forwarding status, alfred was cologne for men on a rainy day. If the MS client does not receive a response from the dhcp server, it will set a 169.169.X.X IP address for the NIC, skf bearing. The solution is to set the switch port to Portfast mode: CatOS (4000/5000/6000): set spantree portfast mod_num/port_num enable, club cohiba san antonio; IOS (2900/3500 ): interface ...; spanning-tree portfast.
In another case, the DHCP server and the DHCP workstation are not in the same VLAN. In this case, ip helper-address is usually set to solve the problem:
- Interface vlan1
- Ip address 10.1.1.254 255.255.255.0 // set the DHCP server address to 10.1.1.8)
- Interface Vlan2
- Ip address 10.1.2.254 255.255.255.0
- Ip helper-address 10.1.1.8 // assume this is the VLAN of the DHCP Client