查询DHCP服务包
#rpm -qa |grep dhcp
装 rpm -ivh 包名称 dhcp-3.0pll-23.i386.rpm
更新 rpm -Uvh 包名称 dhcp-3.0pll-23.i386.rpm
DHCPD 服务名 凡是服务名的名称一般都是以D结尾
主配置文件/etc/dhcpd.conf 默认是为空
cp 将/usr/share/doc/dhcp-3.0pll/dhcpd.conf .sample 拷贝到/etc/dhcpd.conf
修改配置文件/etc/dhcpd.conf
subnet 192.168.0.0 netmask 255.255.255.0 { 网络范围
# --- default gateway
option routers 192.168.0.1; 网关
option subnet-mask 255.255.255.0; 掩码
option domain-name "dos.com"; 域名
option domain-name-servers 192.168.1.1; dns
option time-offset -18000; # Eastern Standard Time 地址偏移时间
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.0.128 192.168.0.255; 地址池
default-lease-time 21600; 租约时间按秒算
max-lease-time 43200; 最大租期
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
vi /etc/sysconfig/dhcpd 指定网卡
DHCPDARGS=eth0
创建客户租期数据库
touch /var/lib/dhcp/dhcp.leases
重启服务 service dhcpd restart
start 启动
客户端先自动获取IP netconfig 空格[*] OK
重启 service network restart
dhclient 客户端获取地址