debian和ubuntu DHCP服务器配置
root@vangeldoro:~# apt-get install dhcp3-server
root@vangeldoro:~# vi /etc/dhcp3/dhcpd.conf
主要是改 option domain-name-server 和 subnet 以及其范围(你的子网ip的范围)
以下我的DNS为两个,电信的那个做为备用DNS, 我的subnet 是192.168.200.0 netmask:255.255.255.0 子网从192.168.200.2-192.168.200.200 .
192.168.200.100 为内网网关,
这样做的好处是防有些软件会自动找192.168.200.1或192.168.200.254网关,
呵呵~~~
200以上地址手动指定,做为实验地址和交接机地址等
以下为主要的几行我自己的实例配置文件:
option domain-name-servers 210.26.24.1, 202.100.64.68;
default-lease-time 14400;
max-lease-time 86400;
subnet 192.168.200.0 netmask 255.255.255.0 {
range 192.168.200.2 192.168.200.200;
option routers 192.168.200.100; }
请按你的要求修改以上几行,修改后保存.
Example:
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
option domain-name-servers 54.17.0.8;
default-lease-time 14400;
max-lease-time 86400;
subnet 54.17.0.0 netmask 255.255.255.0 {
range 54.17.0.101 54.17.0.200;
option routers 54.17.0.1;
}
host target1 {
hardware ethernet 08:00:27:A4:D5:60;
fixed-address 54.17.0.11;
}
host target2 {
hardware ethernet 08:00:27:4A:43:BD;
fixed-address 54.17.0.10;
}
重启 /etc/init.d/dhcp3-server start