ubuntu系列的使用apt-get install dhcpd3
如果源里搜索出错可以将dhcp后面加上*通配,显示出来以后挑选server端或client端相应文件名安装
这个问题包括了linux dhcp除中继外绝大多数功能,我先一个一个的帮你说明一下,最后给出配置文件。首先搭建我就不用多说了,直接使用rpm -ivh安装dhcp服务即可,然后开始写配置文件,默认是个空白的,可以将/usr/share/doc/dhcp-3.0.5/dhcpd.conf复制到sample /etc/dhcpd.conf,然后VI打开这个文件编写(下面是我自己电脑上配置文件)
ddns-update-style interim
ignore client-updates
subnet 192.168.10.0 netmask 255.255.255.0 { 指定的网段
# --- default gateway
option routers 192.168.10.1 网关
option subnet-mask 255.255.255.0 掩码
option nis-domain "domain.org"
option domain-name "domain.org" 域名
option domain-name-servers 192.168.10.2 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.10.1 192.168.10.100分配置IP的范围
default-lease-time 21600 默认租期
max-lease-time 43200 最大租期
# we want the nameserver to appear at a fixed address
host ns { 绑定MAC与IP
next-server marvin.redhat.com
hardware ethernet 00:0c:29:61:3c:3c
fixed-address 192.168.10.2
}
}
只是你的要求中有要排除一些IP ,以及绑定多个IP,下面将继续说明。
比如说在192.168.10.1到192.168.10.100中要排除192.168.10.10~192.168.10.20,可以写两段IP范围,即
range 192.168.10.1 192.168.10.9
range 192.168.10.21 192.168.10.100
绑定多个IP
host ns {
hardware ethernet a4:d5:6b:55:9d:43
fixed-address 192.168.10.1
}
host ns {
hardware ethernet 1a:6f:8c:12:23:5a
fixed-address 192.168.10.2;
}
然后启动DCHP服务
service dhcpd start
查看DHCP服务状态
servic dhcpd staus
到此完毕,如果启动出错一般是配置文件写错了,注意标点符号,你自己总结下,归纳下即可完成。
不足之处,敬请见谅!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)