Linux Operations Phase III (II) DHCP services

Source: Internet
Author: User

Linux operation and Maintenance Phase III (II) DHCP services

1, software package:DHCP;

Service Name: Main program DHCPD, Relay service Dhcrelay;

Port:udp67,546, 547;

configuration file:/etc/dhcp/dhcpd.conf master configuration file

/etc/sysconfig/dhcrelay Relay configuration file

/usr/share/doc/dhcp*/dhcpd.conf.sample Master profile template

2. Build Dhcp

server: #yum-y Install DHCP

#cp/usr/share/doc/dhcp*/dhcpd.conf.sample/etc/dhcp/dhcpd.conf

#vi/etc/dhcp/dhcpd.conf Delete redundant configuration, keep a subnet area

Subnet 192.168.1.0 netmask 255.255.255.0 {

Range 192.168.1.10 192.168.1.100;

Option routers 192.168.1.2;

Option Subnet-mask 255.255.255.0;

Option Domain-name-servers 192.168.1.2;

Default-lease-time 21600;

Max-lease-time 23200;

}

client:#vi/etc/sysconfig/network-scripts/ifcfg-eth0

Device=eth0

Onboot=yes

Bootproto=dhcp

#service dhcpd Restart

3. Build DHCP Relay Service:

server: #yum-y Install DHCP

#cp/usr/share/doc/dhcp*/dhcpd.conf.sample/etc/dhcp/dhcpd.conf

#vi/etc/dhcp/dhcpd.conf Delete redundant configuration, keep a subnet area

Subnet 192.168.1.0 netmask 255.255.255.0 {

Range 192.168.1.10 192.168.1.100;

Option routers 192.168.1.2;

Option Subnet-mask 255.255.255.0;

Option Domain-name-servers 192.168.1.2;

Default-lease-time 21600;

Max-lease-time 23200;

}

Subnet 200.200.200.0 netmask 255.255.255.0 {

Range 200.200.200.10 200.200.200.100;

Option routers 200.200.200.1;

Option Subnet-mask 255.255.255.0;

Option Domain-name-servers 200.200.200.1;

Default-lease-time 21600;

Max-lease-time 23200;

}

#service dhcpd Restart

#route Add default GW 192.168.1.2

Relay side:

#yum-y Install DHCP

#vi/etc/sysctl.conf

Net.ipv4.ip_forward=1

#sysctl-P

#vi/etc/sysconfig/dhcrelay

Interface= "Eth0 eth1"

Dhcpserver= "192.168.1.1"

#service dhcrelay Restart

Client:

#vi/etc/sysconfig/network-scripts/ifcfg-eth0

Device=eth0

Onboot=yes

Bootproto=dhcp

#service Network Restart

From Brother Lian Training

This article is from the "Linux Operational Difficulty Learning notes" blog, please be sure to keep this source http://jowin.blog.51cto.com/10090021/1654840

Linux Operations Phase III (II) DHCP services

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.