2018年6月4日星期一

在树莓派上设置PXE服务器,支持从网络启动

在树莓派上安装PXE服务,并使用grub4dos引导系统
参考:
1. https://en.wikipedia.org/wiki/Preboot_Execution_Environment
2. https://github.com/chenall/grub4dos/blob/master/README_GRUB4DOS_CN.txt

一、安装dnsmasq,配置dhcp和tftp服务
sudo apt-get install dnsmasq
修改配置文件/etc/dnsmasq.conf,在文件末尾添加如下内容:
interface=eth0
dhcp-range=192.168.0.2,192.168.0.253,255.255.255.0,12h
enable-tftp
tftp-root=/tftpboot
dhcp-boot=grldr
dhcp-option=3,192.168.0.1

二、配置网卡eth0为静态IP地址
修改/etc/network/interface文件
auto eth0
iface eth0 inet static
        address 192.168.0.1
        netmask 255.255.255.0

三、建立tftpboot文件夹
cd /
sudo mkdir tftpboot
cp grldr /tftpboot
chown -R nobody: /tftpboot

四、设置dnsmasq开机启动
systemctl enable dnsmasq

五、重启系统



没有评论:

发表评论