我们知道dhcp 就是动态ip 地址分配服务拉!在一个网络中,如果电脑不是很 多的情况下,我们一般都是手动给每个电脑分配ip地址等一些网络的设定。如果一个网络中有上百台电脑,我们也要一台台跑去设定他们的ip 地址 ,那样我想人都会设置的头昏 还得上串下跳的到处跑。本人的公司是小公司 只有10几台电脑,我很懒所以用linux配置了dhcp动态分配ip地址的服务!
一般来说我们在安装linux时如果选了everything,那么你的dhcp也就有了。真好啊~!但是你想要它 能够正常工作起来 ,那还得你自己动动手。
DHCPd后台程序总是读取配置文件/etc/dhcpd.conf, 下面给出一我主机上的DHCP配置文件的例子:
ddns-update-style interim;
ignore client-updates;
subnet 192.168.25.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.25.15;
option subnet-mask 255.255.255.0;
# option nis-domain "uc88.domain";
option domain-name "uc88.domain";
option domain-name-servers 202.96.128.68,192.168.25.15;
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.25.100 192.168.25.254;
default-lease-time 259200;
max-lease-time 518400;
# 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;
# }
}
[Linux教程]linux下DHCP服务实例解析
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://www.heiqu.com/5779e7623abffa2087c1f49ef0468fd0.html