Implementation of DHCP relay proxy in Linux

Source: Internet
Author: User
Article Title: How to Implement DHCP relay proxy in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

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.

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.

The eth1 of dhcprelay 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 Timedefault-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 the 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.