CentOS6.5 install the dhcp server

Source: Internet
Author: User

CentOS6.5 install the dhcp server
CentOS6.5-dhcp Server Installation

Run the following command:

Setting: SELINUX

Set SELinux to permissive mode or disable it;

1. to modify the configuration file, restart the machine:

Modify the/etc/selinux/config file

Go to edit file:

Vi/etc/selinux/config

Change SELINUX = enforcing to SELINUX = disabled and restart the machine.

2. Add the port first:

Set firewall:

# Vi/etc/sysconfig/iptables

Add the following two rows:

AINPUT-mstate-stateNEW-mudp-pudp-dport67-jACCEPT

AINPUT-mstate-stateNEW-mudp-pudp-dport68-jACCEPT

Restart NIC:

/Etc/init. d/iptablesrestst

Formal installation of dhcp service:

1. DHCP Server installation purpose: the server controls the IP address range. When a client logs on to the server, it can automatically obtain the IP address and subnet mask allocated by the server.

2. Installation Method:

# Yuminstalldhcp

Edit the configuration file:

# Cp/usr/share/doc/dhcp-4.1.1/dhcpd. conf. sample/etc/dhcp/dhcpd. conf

Edit:

# Vi/etc/dhcp/dhcpd. conf

Ddns-update-styleinterim; # configure dynamic update mode with DHCP-DNS

Ignoreclient-updates; # ignore client updates

Subnet172.25.0.0netmask?=192.0 {# Scope

Optionrouters172.25.0.1; # router address (Gateway)

Optionsubnet-mask255.255.192.0; # subnet mask options

Optionnis-domain "ostv.org ";

Optiondomain-name "ostv.org"; # Domain name

Optiondomain-name-servers8.8.8.8; # DNS address

Optiontime-offset-18000; # Set the offset time for the Greenwich Mean Time for the client, in seconds

Rangedynamic-bootp172.25.0.100172.25.0.150; # lease IP address range

Default-lease-time21600; # default lease time

Max-lease-time43200; # Max lease time

}

Start the DHCPD service and view the Port:

There are two methods to start a service command:

First: #/etc/init. d/dhcpdstart

Type 2: # servicedhcpdstart

Note: Stop command

First: #/etc/init. d/dhcpdstop

Type 2: # servicedhcpdstop

Check whether startup is successful:

# Netstat-panu | grepdhc *

Note:

Disable SELinux before installing MySQL. The steps are as follows:

1. Disable SELinux and restart the system;

Check whether startup is successful:

# Netstat-panu | grepdhc *

Database File dhcpd. leases for customer lease

# Cat/var/lib/dhcpd. leases

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.