认证培训,h3c认证体系,网络工程师
丰沃创新

DHCP服务器配置【网络工程师培训】

  • 发布时间: 2019-5-24 10:13:10

DHCP = Dynamic Host Configuration Protocol 基于TCP/IP,用于动态配置工作站网络接口,使工作站的网络接口管理自动化。

DHCP服务器软件

dhcpd 网站:http://www.isc.org

安装方法:

#tar -zxvf dhcp-4.0.0.tar.gz

#cd dhcp-4.0.0

#./configure

#make

#make install

#touch /var/db/dhcpd.leases

#vi /etc/dhcpd.conf --编辑配置文件

#/usr/sbin/dhcpd --启动dhcp服务 或者 #dhcpd

主要配置选项

1.默认网关

2.IP地址

3.子网掩码

4.DNS服务器地址

5.租用时间

配置文件 /etc/dhcpd.conf

ddns-update-style none;

subnet 192.168.0.0 netmask 255.255.255.0 {

option routers 192.168.0.1;

option subnet-mask 255.255.255.0;

option domain-name "my zone";

option domain-name-servers 192.168.0.1;

range 192.168.0.3 192.168.0.253;

default-lease-time 21600;

max-lease-time 43200;

host mail {

hardware ethernet 12:34:56:78:AB:CD;

fixed-address 192.168.0.2;

}

}

===========================

#/usr/sbin/dhcpd 启动服务器

#grep bootp /etc/services 查看dhcp端口

#netstat -unl | grep 67

#ssh 192.168.0.11

Linux客户机的配置

/etc/sysconfig/network-scripts/ifcfg-eth0:

DEVICE=etho

ONBOOT=yes

BOOTPROTO=dhcp

或者使用netconfig配置动态地址:

然后运行

#service network restart

#more /etc/resolv.conf

#route -n

调试

调试服务器

1.查看日志文件

#tail -f /var/log/messages

2.查看租用记录文件

#more /var/db/dhcpd.lease

调试客户机

under linux:

#dhclient eth0

#under windows:

C:/>ipconfig /renew