Knowledge and configuration of DHCP relay

Source: Internet
Author: User

In some settings, we usually see the configuration of the DHCP relay function. In a TCP/IP-based LAN, communication between computers depends on the IP address of the host. Therefore, each server and workstation in the network must have a unique IP address. The IP address allocation method is very important for effective network management.

IP Address Allocation Method

Generally, IP addresses are allocated in two ways based on the local network structure, scale, and management mode:

1. manually set the static allocation scheme according to the network administrator's address plan.

2. DHCP-based Dynamic Allocation Scheme.

In the static allocation scheme, you only need to fill in the IP address in the TCP/IP protocol settings of the computer. If the network is divided into multiple VLANs, you also need to fill in the subnet mask, default gateway, and other information, in addition, you may need to enter the DNS server address. This allocation method does not require additional devices. It ensures that each device has a fixed IP address of its own. In a network with multiple VLANs, the interconnection between computers is easier to implement. However, the static allocation method will bring a lot of work to the network administrator, and it is easy to have duplicate IP addresses. Therefore, for the convenience and security of network management, DHCP-based Dynamic Address Allocation Scheme is usually selected. The DHCP solution can automatically specify IP addresses, subnet masks, default gateways, DNS, and WINS server addresses for the workstation without any configuration.

DHCP settings in Multi-VLAN Networks

From the working principle of DHCP, we can see that the communication between the client and the server is broadcast, this is easy to implement in a shared or non-VLAN-based switch network. When the network is divided into multiple VLANs, the broadcast information is limited to the VLAN where the client is located. If the client and DHCP server are not in the same VLAN, the request information cannot be transmitted to the DHCP server, and the IP address and related configuration parameters cannot be automatically obtained. To solve this problem, we can set a DHCP server in each VLAN. The client obtains the IP address, subnet mask, default gateway, and DNS server address through the DHCP server located in the same VLAN. However, this solution requires setting up multiple computers as DHCP servers, which requires not only a large amount of investment, but also a large workload for server maintenance. The DHCP relay function in layer-3 switches provides us with a very good solution. By enabling the DHCP relay function for each VLAN and the related ports in the layer-3 switch, the VLAN interface address, that is, after the default gateway receives the DHCP request broadcast information from the client in the VLAN, the default gateway acts as the DHCP proxy to forward request information to the DHCP server. In DHCP relay, the interface address of each VLAN is used as the DHCP proxy for this VLAN. To use the DHCP relay function, you only need to set a DHCP server in the network, and the DHCP server can be located in any VLAN. When setting the DHCP relay parameter, you can specify the IP address of the DHCP server.

When DHCP relay is used in a multi-VLAN network, you need to configure the layer-3 Switch and DHCP server.

Settings in layer-3 Switch

In a layer-3 switch, you can set parameters such as the IP address of the proxy and the IP address of the DHCP server. Take the layer-3 vswitch Passport8600 as an example. There are three VLANs in the network, whose interface addresses are 192.168.1.254, 192.168.2.254, and 192.168.3.254. the DHCP server address is 192.168.1.1, the ports for enabling DHCP relay in a layer-3 Switch are 1/1, 1/2, 1/3, 2/1, and 2/2.

Go to the command line Setting interface of Passport8600 and execute the following command //... // It is the description of the command ):

Conf vlan 1 ip dhcp-relay enable // start the DHCP relay function of VLAN 1 //

Conf vlan 2 ip dhcp-relay enable // start the DHCP relay function of VLAN 2 //

Conf vlan 3 ip dhcp-relay enable // start the DHCP relay function of VLAN 3 //

Conf ethernet 1/1-1/3 ip dhcp-relay enable // enable DHCP relay function on port 1/1-1/3 //

Conf ethernet 2/1-2/2 ip dhcp-relay enable // enable DHCP relay function on port 2/1-2/2 //

Conf ip dhcp-relay create-fwd-path agent 192.168.1.254 server 192.168.1.1 mode bootp_dhcp state enable

// Specify the forwarding path for the DHCP relay. The relay proxy address is the interface address of VLAN 1, and the DHCP server address is 192.168.1.1. The allowed modes are both BOOTP and DHCP //

Conf ip dhcp-relay create-fwd-path agent 192.168.2.254 server 192.168.1.1 mode bootp_dhcp state enable // same as above //

Conf ip dhcp-relay create-fwd-path agent 192.168.3.254 server 192.168.1.1 mode bootp_dhcp state enable // same as above //

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.