DNSMASQ做局域网内的pxe installl是最合适不过的软件了。不用单独搭建 tftpserver,用自建的即可。
而且支持给各种子网打标签,还可以按标签发送各种dhcp包的特定信息。
interface=eth0 bind-dynamic pxe-prompt="Rendoumi PXE System", 5 domain-needed bogus-priv no-resolv no-poll #address=/jump.dedi.jp/install/103.108.236.5 #UP Stream DNS Server server=114.114.114.114 server=202.106.196.115 server=202.106.0.20 strict-order dhcp-authoritative dhcp-sequential-ip dhcp-no-override log-facility=/var/log/dnsmasq.log log-dhcp log-queries enable-tftp tftp-root = /export/servers/tftpboot #only new add host is dynamic, delete or modify not. #dhcp-hostsfile=/etc/dhcp-host/hosts.conf dhcp-hostsdir=/etc/dhcp-host # #Setup different options for each of the unique subnets, since default gateways will be different #The format for this is: dhcp-options=<your_tags_here>,<option>,<option_value> - #3 is router #1:netmask, 15:domain-name, 3:router, 6:dns-server, #44:netbios-ns, 46:netbios-nodetype, 47:netbios-scope, #31:router-discovery, 33:static-route, 121:classless-static-route, #43:vendor-encap # dhcp-option=option:dns-server,172.18.30.1,172.18.30.2 dhcp-option=option:all-subnets-local,1 dhcp-option=option:T1,2m dhcp-option=option:T2,4m #dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag>,]<start-addr>[,<end-addr>|<mode>][,<netmask>[,<broadcast>]][,<lease time>] #vlan 1 native vlan #dhcp-range=set:net1,172.18.29.100,172.18.29.250,static,255.255.254.0,2m dhcp-range=set:net1,172.18.29.100,static,2m dhcp-option-force=tag:net1,option:router,172.18.29.254 #vlan 199 wuli #dhcp-range=set:net2,172.18.31.100,static,255.255.254.0,2m #dhcp-range=set:net2,172.18.31.100,255.255.254.0,2m dhcp-range=set:net2,172.18.31.100,static,2m dhcp-option-force=tag:net2,option:router,172.18.31.254 # set tag "ipxe" if request comes from iPXE ("iPXE" user class) dhcp-userclass=set:ipxe,iPXE # alternative way, look for option 175 #dhcp-match=set:ipxe,175 # gPXE/iPXE sends a 175 option. # if request comes from dumb firmware, send them iPXE (via TFTP) #dhcp-boot=tag:!ipxe,undionly.kpxe,boothost,172.18.29.2 dhcp-boot=tag:!ipxe,undionly.kpxe # if request comes from iPXE, direct it to boot from boot1.php #dhcp-boot=tag:ipxe,http://172.18.29.2/pxeboot/boot1.php #--dhcp-boot=[tag:<tag>,]<filename>,[<servername>[,<server address>|<tftp_servername>]] dhcp-boot=tag:ipxe,tag:net1,http://172.18.29.2/pxeboot/boot1.php,172.18.29.2 dhcp-boot=tag:ipxe,tag:net2,http://172.18.31.2/pxeboot/boot1.php,172.18.31.2 # Args add(old del) mac ip hostname # add ac:1f:6b:21:3e:d8 103.108.236.22 1403-s27 #dhcp-script=/bin/echo #dhcp-leasefile=/var/log/dnsmasq.leases # !!!! tag is alphanumeric label, fuck !!!!! 附上undionly.kpxe:undionly.kpxe
...