Install DHCP Service

Source: Internet
Author: User

Configure DHCP server

I,InstallDHCPSoftware Package
Rpm-ivh/misc/cd/Server/dhcp-3.0.5-23.e15.i386.rpm

II,Create a master configuration fileDhcp. conf
[Root @ localhost ~] # Cp/usr/share/doc/dhcpd-3.0.5/dhcpd. conf. samole/etc/dhcpd. conf
[Root @ localhost ~] # Vim/etc/dhcpd. conf
Ddns-update-style none; // disable Dynamic DNS update.

Option domain-name "bene.com"; // specify the default search domain

Option domain-name-servers 192.168.1.1, 202.96.128.68; // DNS address

Default-lease-time 21600; // default lease for 6 hours

Max-lease-time 43200; // The maximum lease size is 12 hours.


Subnet 192.168.0.0 netmask 255.255.255.0 {

Option routers 192.168.0.1; // specify the Default Gateway

Option subnet-mask 255.255.255.0; // subnet

Range 192.168.0.128192.168.0.254; // address range


Host ns {

Next-server marvin.redhat.com;

Hardware ethernet 12: 34: 56: 78: AB: CD; // reserved for the client address

Fixed-address 192.168.0.129;

}

III,StartDhcpdService(Service dhcpd configtest can check the configuration script)

[Root @ localhost ~] # Service dhcpd start
[Root @ localhost ~] # Chkconfig dhcpd on // Add the running level

[Root @ localhost ~] # Netstat-naup | grep ": 67" // view the dhcpd service port


IV,ConfigurationDHCPClient

[Root @ localhost ~] # Vim/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE = eth0

ONBOOT = yes // start on startup

BOOTPROTO = dhcp

[Root @ localhost ~] # Dhclient-d eth0 // automatically obtain the new IP Address

[Root @ localhost ~] # Dhclient-r eth0 // release and obtain the IP address again

[Root @ localhost ~] # Less/var/lib/dhcpd. leases // view allocated IP addresses


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.