我假设您已安装 bootpd 软件包。默认配置文件是/etc/bootptab,其语法在 bootptab 手册页中详细说明。让我们创建它。
.default\ :sm=your subnet mask\ :ds=the IP address of your DNS server\ :ht=ethernet\ :dn=your domain name\ :gw=the IP address of your gateway\ :sa=the IP address of the TFTP server\ :bf=path to find the kernel image\ :rp=path of the root filesystem\ :hn |
然后,在您的网络中为每个客户端添加一个条目。一个条目应如下所示
dns of the client\ :ha=MAC address of the client\ :ip=IP address of the client |
.default\ :sm=255.255.0.0\ :ds=192.168.0.2\ :ht=ethernet\ :dn=frtest.org\ :gw=192.168.0.1\ :sa=192.168.0.2\ :bf=/tftpboot/kernel\ :rp=/nfsroot\ :hn foo\ :ha=001122334455\ :ip=192.168.2.12 bar\ :ha=00FFEEDDCCBB\ :ip=192.168.12.42\ :ds=192.168.2.42 |
然后,使用 bootpd -s 命令运行 bootpd 守护进程(将其添加到启动脚本中也是一个好主意),或者将以下行添加到您的/etc/inetd.conf:
bootps dgram udp wait root /usr/sbin/tcpd�bootpd -i -t 120 |
设置 TFTP 守护进程并不难:只需安装 tftpd 软件包(如果有),并将以下行添加到您的/etc/inetd.conf(同样,我假设/tftpboot是内核镜像所在的目录)
tftp dgram udp wait root /usr/sbin/tcpd in.tftpd /tftpboot |
现在您已经正确设置了所有守护进程,您可以重启 inetd 并喝杯咖啡。别忘了告诉大家服务器设置已完成,这样您就可以在开始为客户端构建根文件系统之前觉得自己像个英雄。