DHCP service under Linux
Operating system: redhat6.0
I. Structure description
1 gateway Address: 192.168.107.1, subnet mask: 255.255.255.0
2) DHCP server (Redhat 6.0).
IP configuration for DHCP:
3) a client computer. IP is automatically assigned by DHCP.
Second, install the DHCP service [at the DHCP server (os:redhat 6.0), ip:192.168.107.11]
[root@alex01 ~]# Yum Install dhcp*
Iii. Configuring the DHCP service [at the DHCP server (os:redhat 6.0), ip:192.168.107.11]
[root@alex01 dhcp]# RPM-QC DHCP
This/etc/dhcp/dhcpd.conf is a dbcp configuration file.
Open inside is empty, so we can then copy one of its help documents inside.
1)
[root@alex01 dhcp]# cp/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
2)
Configure dhcpd.conf
3)
Restart Service (DHCP port number is 67)
Iv. Configuring Clients
1) See IP, as shown now, no IP assigned
2) Configure DHCP
3) Restart the network
/etc/init.d/network restart
4 again, see IP, in fact, you can get DHCP for its assigned IP.
5 The client is the location where the DHCP server is located by sending broadcast packets.
V. Physical address binding IP [at the DHCP server (os:redhat 6.0), ip:192.168.107.11]
1 Add the following in the/etc/dhcp/dhcpd.conf.
2 Start service [at DHCP server (os:redhat 6.0), ip:192.168.107.11]
/ETC/INIT.D/DHCPD restart
3 from the client above the network card service
/etc/init.d/network restart
4 to view the IP on the client computer again, you can see, has become 192.168.107.200.
Vi. DHCP Options
Cat/var/lib/dhcpd/dhcpd.leases
Starts:lease Start Lease time
Ends:lease End Lease Time
#dhcp服务器和客户端租约建立的启动和到期时间的记录文件, only after the client has requested an IP address.
Vii. Description of DHCP configuration parameters (this is reproduced)
Some items must be set with option, in the form of option< parameter code >< setting content >
DHCP IP is divided into static IP and dynamic IP, if set static IP need to know to set the host's MAC address, #ping target host IP, #arp –n view.
parameters (Parameters): shows how to perform a task, whether to perform a task, or which network configuration options to send to a customer
Defaults-lease-time: Default lease time, default unit is seconds
Max-lease-time: Maximum lease time, when the client exceeds the lease but has not yet updated the IP, the longest time that IP can be used
Ddns-update-style configuration Dhcp-dns Interactive update mode
Default-lease-time Specify the length of the lease time, the unit is seconds
HARDWARE Specifies the NIC interface type and MAC address
Server-name notify DHCP Client server name
Get-lease-hostnames flag Check the IP address used by the client
Fixed-address IP assigned to client with a fixed address
Authritative rejects incorrect IP address requirements
Option (options): used to configure DHCP optional parameters, all start with the option keyword
Option routers: Set a default gateway for clients
Option Subnet-mask: Set subnet mask for client
Option Domain-name: Indicates the DNS name for the client
Option domain-name-servers: Indicates the DNS server IP address for the client
Option Time-offset: Set the offset time for the client and GMT, in seconds
Option Ntp-server: Set Network time server IP address for client
Option Host-name Specifies the host name for the client. If the client uses Windows, do not select Host-name, that is, do not specify a host name for it.
Option Broadcast-address set broadcast address for client
declarations (disclaimer): Describe the network layout, provide the customer's IP address, etc.
Shared-network: Tell if some subnets share the same network
Subnet: Describes whether an IP address belongs to the subnet
Range: Start IP termination IP provides a range of dynamically assigned IP
Host: Reference to special host name
Group: Providing a declaration for a set of parameters
Allow Unknown-clients/deny Unknown-client: whether to dynamically assign IP to unknown consumers
Allow Bootp/deny BOOTP: whether to respond to activation queries
Allow Booting/deny booting: whether to respond to user queries
FileName: Start file name, apply to diskless workstation
Next-server: Sets the server to load from the boot file as a host name and applies to diskless workstations.