Network management experience: Use the switch to do the DHCP server

Source: Internet
Author: User
Tags command line get ip range resource switches cisco switch

What is a DHCP server? Why do we need to configure a DHCP server?

The so-called DHCP is the Dynamic Host Configuration protocol abbreviation, that is, dynamically hosted configuration Protocol, which is a TCP/IP protocol cluster, the main role for other computers in the network dynamic allocation of IP address.

Simply talking about the DHCP protocol may be very strange to everyone, but when it comes to "automatic access to IP addresses", you may be more familiar with the installed experience of friends. Under Windows 2000, after we open the Local Area Connection Properties dialog box, double-click Internet Protocol (TCP/IP) and open the Internet Protocol (TCP/IP) Properties dialog box, there is an "automatically get IP address" (Of course we can also directly specify a fixed IP to the computer). But why do we have computers to automatically get the IP? Imagine, if each computer can automatically get any IP, it is not a serious IP address conflict, the network world chaos. However, in real life, the use of automatic access to IP networks is not as chaotic as we imagine, why? The reason is that there is a DHCP server in our network, the DHCP server manages the IP address resources in the network, so that each IP address can be reasonably assigned to each host in the network.

Why do we sometimes need a DHCP server to automate the allocation of IP? For example, if there are 400 computers in a certain unit, there will not be more than 255 computers on the Internet at any one time. If the use of fixed IP, then we need to apply for this unit 400 IP to be sufficient, but if we use dynamic IP allocation, we only apply for 255 IP is enough, save 145 IP resource costs. The DHCP service is specifically tested for the low density of this IP resource usage. (Computer science)

However, the conventional approach, the need to specifically configure a server to do the DHCP server, which undoubtedly increased network costs. According to the author's experience, sometimes in some network low-level devices (such as routers, switches, etc.) inside the integration of DHCP services, in general, small networks, we can fully use these network devices on the network is the DHCP service to configure our own DHCP server, Instead of having to specifically configure a single server to do the DHCP service.

I'll take the Cisco switch (no other switch) as an example, and say the exact following:

Suppose there are 400 hosts in a network, of which 255 are requested for allocation of IP, the range from 202.38.x.0~202.38.x.254, where 202.38.x.1 is used to allocate to the gateway, the network has three servers A, B, C, it needs a fixed IP, 202.38.x.2, 202.38.x.3, 202.38.x.4, all other IP are for dynamic allocation. The network topology is as follows:

  

Telnet landing on the switch, into the switch command line;

To start the DHCP service:

Service DHCP

For IP to be fixed, we need to set it up first:

IP dhcp exclude-address 202.38.x.2 202.38.x.3 202.38.x.4

Before assigning an address, test the address, and if the address is in use, assign a different address to avoid an IP address conflict:

IP DHCP Ping packets 3

Set DHCP address pool global variable,;

IP DHCP Pool 1

To set a dynamically assigned IP address range, subnet mask:

Network 202.38.x.0 255.255.255.0//dynamically assigns IP range, where given is 202.38.x.0 to 255.255.255.0, which is the segment all IP

To set up a gateway:

Default-router 202.38.x.1

Setting DNS server addresses

Dns-server 202.38.193.33 202.112.17.33

As simple as this, a DHCP server configuration on a Cisco switch is complete. Please note that not all switches are equipped with DHCP service, the author is using a Cisco switch, so please pay attention to use when you buy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.