Implementation of DHCP relay proxy in Linux

Source: Internet
Author: User
How to Implement DHCP relay proxy in Linux-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Li Lei QQ19840817

I implemented it in a virtual machine environment. Generally, when a virtual machine is opened, it will slow down. We only use one 2003 Server for customer service machine verification, during verification, you only need to set different Nic channels of 2003.
Red Hat Enterprise Edition for lab 4

Lab platform:
Two LINUX servers, one DHCP server, one dhcprelay proxy server, and one PC2003 for testing.

Three CIDR blocks: 192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
The three NICs of the DHCP relay Proxy Server are eth0, eth1, and eth2.
Eth0: 192.168.1.1
Eth1: 192.168.2.1
Eth2: 192.168.3.1
The NIC of the DHCP server is eth0.
Eth0: 192.168.1.2
The eth0 of the dhcp server and the eth0 of dhcprelay are both set to vmnet2.
Dhcprelay's eth1 is set to vmnet3 when Customer Service 2003 is set to vnnet3, the ip address of 192.168.2.0/24 should be obtained.
Set eth2 of hcprelay to vmnet4 when Customer Service 2003 is set to vnnet4
The ip address of 192.168.3.0/24 should be obtained.

Configure the IP address of each network adapter. Be sure not to configure the IP address correctly. After the environment is set up, you can start.
The first step is to configure DHCP.

1 open the dhcpd. conf file and write it to the file
Ddns-update-style interim;

Ignore client-updates;

Option time-offset-18000; # Eastern Standard Time


Default-lease-time 259200;
Max-lease-time 777600;


# Configure three scopes below

Subnet 192.168.1.0 netmask 255.255.255.0 {

Option routers 192.168.1.1;

Range dynamic-bootp 192.168.1.5 192.168.1.254;

}

Subnet 192.168.2.0 netmask 255.255.255.0 {


Option routers 192.168.2.1;

Range dynamic-bootp 192.168.2.5 192.168.2.254;

}

Subnet 192.168.3.0 netmask 255.255.255.0 {

Option routers 192.168.3.1;

Range dynamic-bootp 192.168.3.5 192.168.7.254;

}
Save and exit
Then start DHCP service dhcpd start
Refresh firewall iptables-F note that F is capitalized
DHCP is configured here. You can configure OPTION as needed.
Next, configure DHCPRELAYL.
Echo 1>/proc/sys/net/ipv4/ip_forward # Start Routing
Dhcprelay 192.168.1.2 # dhcp relay for 192.168.1.2
Iptables-F
Service dhcpd restart
You can.
Then, put 2003 in different Wmnet to get the IP address.
Related Article

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.