rpm package in the first four CD-dhcp-3.0.3-26.i386.rpm
Compile the installation method
# tar zxvf dhcp-latest.tar.gz
# cd dhcp-3.0.3
#. / configure
# make
# make install
# vi / etc / dhcpd.conf
# touch / var / state / dhcp / dhcpd.leases rpm install do not touch, the default file installed in / var / lib / dhcpd / dhcpd.leases
# dhcpd
The main configuration options
1. Default Gateway
2.IP Address
3. Subnet mask
4.DNS server address
5. Lease time
/ etc / dhcpd.conf:
ddns-update-style none; must have a
subnet 192,168.0.0 netmask 255.255.255.0 (range of specified services
option routers 192.168.0.22
option subnet-mask 255.255.255.0
option domain-name "chinaitlab.com";
option domain-name-servers 192.168.0.22;
range 192.168.0.128 192.168.0.254;
default-lease-time 21600; 6 hours
max-lease-time 43200; 12 hours
NIC host mail (address allocation in accordance with a fixed IP
hardware Ethernet 12:34:56:78: ab: cd;
fixed-address 192.168.0.5;
)
)
UDP67 the default server port.
Linux client configuration
Modify / etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE = eth0
ONBOOT = yes
BOOTPROTO = dhcp
Or use netconfig to configure dynamic address, and then running # service network restart
Set after 1 minute to perform your operation:
# at now +1 minutes
at> service network restart
ctrl + D end
Debug Server:
# tail / var / log / messages to view the log information
# more / var / lib / dhcpd / dhcpd.leases view the distribution of IP
Debug client:
Under unix:
# dhclient eth0 DHCP client tools, refresh card eh0, send a broadcast, re-request an IP
Under windows:
C: \> ipconfig / renew
Application Case
Requirements:
Configure a DHCP server for the distribution of 100 host addresses, use the 192.168.0.0/24 network segment, the static host address is as follows:
Default Gateway: 192.168.0.254
DNS server: 192.168.0.1
Mail server: 192.168.0.2
DHCP server: 192.168.0.254
Solution:
option routers 192.168.0.254;
option domain-name-server 192.168.0.1;
range 192.168.0.3 192.168.0.102;
host ns (
hardware Ethernet 12:24:34:34: as: de;
fixed-address 192.168.0.1;
)
host mail (
hardware Ethernet 12:34:56:78: ab: cd;
fixed-address 192.168.0.2;
)
0 评论:
发表评论