Use liunx Service (DHCP service automatically obtains the address)

Source: Internet
Author: User

Automatically obtain the address. In windows, it must be very simple. How can I implement it? After reading this article, let's take a good look ..



Service Management

Dhcp Dynamic IP Address Allocation)

Installation Package

Dhcp-3.0.5-31.el5.i386.rpm

Start the service

Service dhcpd restart


Configuration File

/Etc/dhcpd. conf

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


----------------------------------


Subnet 192.168.1.0 netmask 255.255.255.0 {network disconnection set

Option routers 192.168.1.2; Gateway

Option subnet-mask limit 255.0; Sub-mesh Ma

Option domain-name-servers 202.106.0.20; DNS

Range dynamic-bootp 192.168.1.1 192.168.1.254; the allocation range ranges from large to small.

Default-lease-time 21600; lease period time

Max-lease-time 43200; expired when the lease is exceeded


Help set the physical address

Host ns {

27 next-server marvin.redhat.com;

28 hardware ethernet 12: 34: 56: 78: AB: CD; physical address

29 fixed-address 207.175.42.254; address to be set



-----------------------------------------


Principle:

C client) S server)

--- DHCPDISCOVER ---> discovery

<-- DHCPOFFER ------- response

--- DHCPREQUEST ----> request lease time

<-- DHCPACK --------- confirm the lease


------------------------------

Server lease vim/var/lib/dhcpd. lease

Client lease vim/var/lib/dhclient/chclient-eth0.lease


----------------------

DHCP relay server

Purpose: Use two DHCP servers to divide two hosts with different network disconnections, one of which is used as a relay.

DHCP end


Ddns-update-style interim;

Ignore client-updates;

Subnet 192.168.1.0 netmask 255.255.255.0 {

Option routers 192.168.1.2;

Option subnet-mask limit 255.0;

Option domain-name-servers 202.106.0.20;

Range dynamic-bootp 192.168.1.1 192.168.1.254;

Default-lease-time 21600;

Max-lease-time 43200;

}

Subnet 192.168.0.0 netmask 255.255.255.0 {

Option routers 192.168.0.1;

Option subnet-mask limit 255.0;

Option domain-name-servers 202.106.0.20;

Range dynamic-bootp 192.168.0.2 192.168.0.254;

Default-lease-time 21600;

Max-lease-time 43200;

}




Relay end

Vim/etc/sysconfig/dhcrelay main configuration file

1 # Command line options here

2 DHCRELAYARGS = ""

3 INTERFACES = "eth0 eth1" enable relay pointing to the two NICs for Relay)

4 DHCPSERVERS = "192.168.147.1" DHCP server address


Service dhcrelay restart start service


This article is from the "history_xcy" blog, please be sure to keep this http://historys.blog.51cto.com/7903899/1296647

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.