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