Use a vswitch as a DHCP server

Source: Internet
Author: User
Tags dedicated server cisco switch

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

The so-called DHCP Protocol is short for the Dynamic Host Configuration Protocol, that is, the Dynamic Host Configuration Protocol, which is one of the TCP/IP Protocol clusters, it is used to dynamically allocate IP addresses to other computers in the network.

It may be unfamiliar to everyone to talk about the DHCP protocol. But when it comes to "Automatically Obtaining IP addresses", you may be familiar with installation experience. In windows 2000, after opening the "Local Connection Properties" dialog box, double-click "internet Protocol (TCP/IP)" to open the "internet Protocol (TCP/IP) properties" dialog box, there is an item "automatically obtain the IP address" (of course we can also directly specify a fixed IP address to the computer ). But why can we enable the computer to automatically obtain the IP address? Imagine if every computer can automatically obtain any IP address, it would not be a serious conflict of IP addresses or a mess in the online world. However, in real life, the use of networks that automatically obtain IP addresses is not as chaotic as we think. Why? The reason is that this DHCP server exists in our network. This DHCP server manages the IP Address Resources in the network, so that each IP address is allocated to each desired host in the network.

Why do we sometimes need a DHCP server to automatically allocate IP addresses? For example, suppose there are 400 computers in a certain unit, but at any time, there will be no more than 255 computers going online. If we use a fixed IP address, we need to apply for 400 IP addresses for this unit. However, if we use dynamic IP Address Allocation, we only need to apply for 255 IP addresses, it saves 145 IP Address resources. The DHCP Service is especially used when the IP resource usage density is low.

However, in the conventional method, you need to configure a dedicated server for DHCP server, which will undoubtedly increase network consumption. According to my experience, sometimes some low-layer network devices (such as routers and switches) Integrate the DHCP service in some small networks, we can use the DHCP service on these network devices to configure our own DHCP server, instead of configuring another server for the DHCP service. Next I will take the cisco switch (Other switches have not been tried) as an example to explain the specific practices:

Assume that there are 400 hosts in a network, of which 255 are requested for allocation. The range is from 202.38.X.0 ~ 202.38.X.254, of which 202.38.X.1 is used to allocate to the Gateway. There are three servers A, B, and C in the network, and their fixed IP addresses are 202.38.X.2, 202.38.X.3, 202.38.X.4, respectively, all other IP addresses are available for dynamic allocation. The network topology is as follows:

Telnet to the vswitch and enter the vswitch command line;

Start DHCP service: service DHCP

For a fixed IP address, we need to first agree on it: ip dhcp exclude-address 202.38.X.2 202.38.X.3 202.38.X.4

Before assigning an address, test the address. If someone is using this address, assign another address to avoid IP address conflict:

Ip dhcp ping packets 3

Set the global variable of the DHCP address pool: ip dhcp pool 1

Set the dynamically assigned IP address range and subnet mask:

Network 202.38.X.0 255.255.255.0 // dynamically allocates IP ranges. The IP ranges from 202.38.X.0 to 255.255.255.0, that is, all IP addresses in this segment.

Set Gateway: default-router 202.38.X.1

Set the DNS server address: dns-server 202.38.193.33 202.112.17.33

This is simple. The DHCP server configuration on a cisco switch is complete. Note that not all vswitches have DHCP services. I use cisco vswitches. Therefore, please pay more attention when buying them.

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.