FreeBSD上DHCP服务器的安装
虚拟机下安装系统
分区:/ fs 500M
swap 256M
/usr fs 2048M
/var fs 500M
/tmp fs 500M
/home fs 1024M
/soft fs 剩余空间
主机名:one
帐号:root
密码:123456
#vi /etc/rc.conf
Sshd_enable=”yes”
Ifconfig em0(本项目是fxp0) 192.168.2.1 netmask 255.255.255.0
Ifconfig em1(本项目是nfe0) 192.168.3.1 netmask 255.255.255.0”
在/etc下
#sh netstart //重启网络
设置ssh,在/etc/ssh下
# vi sshd_config
//做一下修改
permitRootLogin yes
PasswordAuthentication yes
PermitEmptyPasswords yes
安装DHCP
挂载到/mnt下 把安装文件复制到/soft下 安装
在/soft下 tar zxvf dhcp-4.1.0.tar.gz
在dhcp-4.1.0下
# ./configure
#make
#make install
配置DHCP
#find / -name dhcp.conf
# cp /usr/local/etc/dhcp.conf /etc/dhcpd.conf
在/etc/dhcpd.conf 下编辑dhcpd.conf (凡暂时不用的信息一律删除)
# vi /etc/dhcp.conf
subnet 192.168.2.0 netmask 255.255.255.0{
server-identifier 192.168.2.1;
range 192.168.2.10 192.168.2.250;
option broadcast-address 192.168.2.255;
default-lease-time 600;
max-lease-time 7000;
}
Subnet 192.168.3.0 netmask 255.255.255.0 {
server-identifier 192.168.3.1;
range 192.168.3.10 192.168.3.250;
option domain-name-servers 192.168.3.254;
option routers 192.168.3.254;
option broadcast-address 192.168.3.255;
default-lease-time 600;
max-lease-time 7000;
}
Host zhaojian {
Hardware Ethernet 00:1b:fc:4d:96:61
Fixed-address 192.168.2.50
}
Host nefu-jun{
Hardware Ethernet 00:13:77:b7:52:f2
Fixed-address 192.168.2.150
}
Host sunjiachuan{
Hardware Ethernet 00:24:81:6b:60:00
Fixed-address 192.168.3.50
}
在/etc/下编辑 resolv.conf 文件
在/etc下
#whereis dhcp
#cd /usr/local/sbin
注意:凡修改的文件必须备份到/soft下


me26659408 于 2009-08-08 08:53:25发表:
学习下
Jovale 于 2009-08-07 21:51:15发表:
不是很明白