日期:2014-05-16 浏览次数:20682 次
网卡 eth0 (对外) IP 10.0.2.15 netmask 255.255.255.0 gateway 10.0.2.2
网卡 eth1 (对内) IP 192.168.1.1 netmask 255.255.255.0
网络结构如下: 网卡 IP 客户端
以 root 用户登录无盘服务器,执行:
+-----------------------------+
| |
|+-- [eth0] 10.0.2.15 +- to WAN
| |
|+-- [eth1] 192.168.1.1 +- to clients
| | IP from 192.168.1.2 - 192.168.1.254
+-----------------------------+
1. 建需要的目录
#mkdir /diskless
#mkdir /diskless/nfsroot
#mkdir /diskless/tftpboot
#mkdir /diskless/tftpboot/pxelinux.cfg
2. 装需要的软件
#apt-get install dhcp3-server
#apt-get install atftpd
#apt-get install nfs-kernel-server
#apt-get install syslinux
#apt-get install debootstrap
3. 建无盘机用的根文件系统
#debootstrap lenny /diskless/nfsroot?http://mirrors.163.com/debian
#chroot?/diskless/nfsroot
#apt-get install linux-image-2.6.26-2-686
#exit
4. 配置 DHCP 服务
#nano /etc/dhcp3/dhcpd.conf
subnet 192.168.1.0 netmask 255.255.255.0 {
??????? range 192.168.1.2 192.168.1.254;
??????? next-server 192.168.1.1;