1、修改IP和dns
[root@dhcp]#
vim /etc/network/interfaces
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address *.*.*.*
netmask 255.255.255.0
network *.*.*.*.0
broadcast *.*.*.255
gateway *.*.*.1
dns-nameservers 8.8.8.8
[root@dhcp]#
vim /etc/resolv.conf
nameserver 8.8.8.8
2、更新apt包
[root@dhcp]#
apt-get update
3、安装open ssh server (方便远程管理)
[root@dhcp]#
apt-get install
openssh-server
4、安装dhcp3-server
[root@dhcp]#
apt-get install
dhcp3-server
5、修改dhcp配置文档
[root@dhcp]#
vim /etc/dhcp3/dhcpd.conf
#——-开始
authoritative;
ddns-update-style interim;
#ignore client-updates;
# 注释
subnet 192.168.1.0 netmask 255.255.255.0{
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option nis-domain “***.edu.cn”;
option domain-name “***.edu.cn”;
option domain-name-servers 8.8.8.8,8.8.8.4;
option time-offset -18000;
range dynamic-bootp 192.168.1.2 192.168.1.190;
default-lease-time 21600;
max-lease-time 43200;
}
……… #省略其他网段
#—-结束
6、重启dhdp服务,如有问题,可查看/var/log/syslog以及 /var/log/messages,查找故障原因。
[root@dhcp]#
/etc/init.d/dhcp3-server
start
查看dhcp客户端获取地址的记录:
[root@dhcp]#
vim
/var/lib/dhcp3/dhcpd.leases
7、修改三层交换机配置,将该服务器设为dhcp server。
其他:
a. debian移除软件包:apt-get remove package
b. 修改debian源: vim /etc/apt/sources.list