其实习惯了用软件仓库,centos下一个yum install dhcp就搞定.
安装完成后有个配置模版在/usr/share/doc/dhcp-xxx/dhcpd.conf
复制到/etc目录:
代码:
cp dhcpd.conf /etc/dhcpd.conf
用vi编辑,基本配置格式如下:
代码:
subnet IP地址 netmask 子网掩码{
option routers 通告网关地址;
option subnet-mask 子网掩码;
option nis-domain nis域名;
option domain-name 域名;
option domain-name-server DNS;
option time-offset 没弄清楚作用,默认-18000;
option ntp-servers ntp服务器地址;
option netbios-name-servers netbios服务器地址;
option netbios-node-type netbios类型;
range dynamic-bootp 分配起始IP 分配结束IP;
default-lease-time 默认生存时间;
max-lease-time 最大生存时间;
#静态分配配置
host 配置名{
next-server 客服端域名;
hardware 客服端MAC;
fixed-address 固定IP地址;
}
}
需要注意的是配置上的网段必须是和服务器直连的网段.
然后设置开机自动启动:
代码:
chkconfig dhcpd --level 35 on
启动服务:
代码:
service dhcpd restart
打完收工.
看得透又看得远者prevail. ppt.cc/flUmLx ppt.cc/fqtgqx ppt.cc/fZsXUx ppt.cc/fhWnZx ppt.cc/fnrkVx ppt.cc/f2CBVx
ppt.cc/fVjECx ppt.cc/fEnHsx ppt.cc/fRZTnx ppt.cc/fSZ3cx ppt.cc/fLOuCx ppt.cc/fE9Nux ppt.cc/fL5Kyx ppt.cc/fIr1ax ppt.cc/f71Yqx tecmint.com linuxcool.com linux.die.net linux.it.net.cn ostechnix.com unix.com ubuntugeek.com runoob.com man.linuxde.net ppt.cc/fwpCex ppt.cc/fxcLIx ppt.cc/foX6Ux linuxprobe.com linuxtechi.com howtoforge.com linuxstory.org systutorials.com ghacks.net linuxopsys.com ppt.cc/ffAGfx ppt.cc/fJbezx ppt.cc/fNIQDx ppt.cc/fCSllx ppt.cc/fybDVx ppt.cc/fIMQxx ppt.cc/fKlBax
Total Pageviews
5,570,993
No comments:
Post a Comment