DHCP & TFTP 独立部署

对于PXE启动并实施无人值守装机,网上绝大数教程都是利用DHCP + TFTP单独部署实现的,我之前的wiki也是这么用的,没问题,只是后来发现dnsmasq可以同时实现这2个服务,于是将原有方案挪到这里单独记录。

yum install dhcp -y
 
cat > /etc/dhcp/dhcpd.conf <<'EOF'
subnet 172.17.3.0 netmask 255.255.255.0 {
range 172.17.3.100 172.17.3.200;
option domain-name-servers 10.1.1.254;
option routers 172.17.3.254;
# TFTP服务器IP,此处为PXE服务器本机
next-server 172.17.3.1;
# PXE启动文件(pxelinux.0 syslinux包提供)
filename "pxelinux.0";
}
EOF
 
systemctl restart dhcpd
systemctl enable dhcpd
netstat -antulp | grep 67

yum install xinetd tftp-server -y
 
cat > /etc/xinetd.d/tftp <<'EOF'
service tftp
{
    socket_type     = dgram
    protocol        = udp
    wait            = yes
    user            = root
    server          = /usr/sbin/in.tftpd
    server_args     = -s /var/lib/tftpboot  # TFTP的主目录,可修改为其他目录便于管理
    disable         = no  # 修改为no
    per_source      = 11
    cps         = 100 2
    flags           = IPv4
}
EOF
 
systemctl restart xinetd
systemctl enable xinetd
netstat -antulp | grep 69
  • linux/os_provision/dhcp_tftp独立部署.txt
  • 最后更改: 2019/04/16 18:31
  • (外部编辑)