Configuring DHCP relay agents under Linux

Source: Internet
Author: User
Tags range linux

Suppose a computer makes a soft route, has three network cards, connects 3 different network segments, 192.168.1.1/24, 192.168.2.1/24,192.168.3.1/24, where 192.168.1.1/24 the network segment has a DHCP server, So how do you set up the 192.168.2.1/24 and 192.168.3.1/24 to assign IP to the two segments?

First you have to add a superscope in the dhcp.conf file:

Ddns-update-style Interim; ; Specify DHCP-supported DNS dynamic update to interim
Ignore client-updates; Specifies that the client is not allowed to update DNS records.
Shared-network XXXDHCP {; super-acting domain name is XXXDHCP
Option Subnet-mask 255.255.255.0;
Option Domain-name-servers 192.168.1.2,192.168.1.10,192.168.4.1;
Option broadcast-address 192.168.1.255;
Default-lease-time 86400;
Max-lease-time 172800;
}
  
Subnet 192.168.1.0 netmask 255.255.255.0 {
Range 192.168.1.21 192.168.1.49;
Option routers 192.168.1.1;
Host PC1 {
Hardware Ethernet MAC;
Fixed-address 192.168.1.20;
}
}
  
Subnet 192.168.2.0 netmask 255.255.255.0 {
Range 192.168.2.21 192.168.2.49;
Option routers 192.168.2.1;
Host PC1 {
Hardware Ethernet MAC;
Fixed-address 192.168.2.20;
}
}
  
Subnet 192.168.3.0 netmask 255.255.255.0 {
Range 192.168.3.21 192.168.3.49;
Option routers 192.168.3.1;
Host PC1 {
Hardware Ethernet MAC;
Fixed-address 192.168.3.20;
}
}

DHCP client under Linux:/etc/sysconfig/network-scripts/ifcfg-eth0 modifies bootproto= "None" to Bootproto= "DHCP"

If you need to boot the network automatically when the system starts,/etc/sysconfig/networking the Networking=yes.

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.