DNSMASQ配置PXE的方式

DNSMASQ做局域网内的pxe installl是最合适不过的软件了。不用单独搭建 tftpserver,用自建的即可。

而且支持给各种子网打标签,还可以按标签发送各种dhcp包的特定信息。

 1interface=eth0
 2bind-dynamic
 3
 4pxe-prompt="Rendoumi PXE System", 5
 5
 6domain-needed
 7bogus-priv
 8no-resolv
 9no-poll
10
11#address=/jump.dedi.jp/install/103.108.236.5
12
13#UP Stream DNS Server
14server=114.114.114.114
15server=202.106.196.115
16server=202.106.0.20
17strict-order
18
19dhcp-authoritative
20dhcp-sequential-ip
21dhcp-no-override
22
23log-facility=/var/log/dnsmasq.log
24log-dhcp
25log-queries
26
27
28enable-tftp
29tftp-root = /export/servers/tftpboot
30
31#only new add host is dynamic, delete or modify not.
32#dhcp-hostsfile=/etc/dhcp-host/hosts.conf
33dhcp-hostsdir=/etc/dhcp-host
34
35#
36#Setup different options for each of the unique subnets, since default gateways will be different
37#The format for this is: dhcp-options=<your_tags_here>,<option>,<option_value> - 
38#3 is router
39#1:netmask, 15:domain-name, 3:router, 6:dns-server,
40#44:netbios-ns, 46:netbios-nodetype, 47:netbios-scope,
41#31:router-discovery, 33:static-route, 121:classless-static-route,
42#43:vendor-encap
43#
44dhcp-option=option:dns-server,172.18.30.1,172.18.30.2
45dhcp-option=option:all-subnets-local,1
46dhcp-option=option:T1,2m
47dhcp-option=option:T2,4m
48
49#dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag>,]<start-addr>[,<end-addr>|<mode>][,<netmask>[,<broadcast>]][,<lease time>]
50#vlan 1 native vlan
51#dhcp-range=set:net1,172.18.29.100,172.18.29.250,static,255.255.254.0,2m
52dhcp-range=set:net1,172.18.29.100,static,2m
53dhcp-option-force=tag:net1,option:router,172.18.29.254
54
55#vlan 199 wuli
56#dhcp-range=set:net2,172.18.31.100,static,255.255.254.0,2m
57#dhcp-range=set:net2,172.18.31.100,255.255.254.0,2m
58dhcp-range=set:net2,172.18.31.100,static,2m
59dhcp-option-force=tag:net2,option:router,172.18.31.254
60
61
62# set tag "ipxe" if request comes from iPXE ("iPXE" user class)
63dhcp-userclass=set:ipxe,iPXE
64
65# alternative way, look for option 175
66#dhcp-match=set:ipxe,175 # gPXE/iPXE sends a 175 option.
67
68# if request comes from dumb firmware, send them iPXE (via TFTP)
69#dhcp-boot=tag:!ipxe,undionly.kpxe,boothost,172.18.29.2
70dhcp-boot=tag:!ipxe,undionly.kpxe
71
72
73# if request comes from iPXE, direct it to boot from boot1.php
74#dhcp-boot=tag:ipxe,http://172.18.29.2/pxeboot/boot1.php
75#--dhcp-boot=[tag:<tag>,]<filename>,[<servername>[,<server address>|<tftp_servername>]]
76dhcp-boot=tag:ipxe,tag:net1,http://172.18.29.2/pxeboot/boot1.php,172.18.29.2
77dhcp-boot=tag:ipxe,tag:net2,http://172.18.31.2/pxeboot/boot1.php,172.18.31.2
78
79# Args add(old del) mac ip hostname
80# add ac:1f:6b:21:3e:d8 103.108.236.22 1403-s27
81#dhcp-script=/bin/echo
82#dhcp-leasefile=/var/log/dnsmasq.leases
83# !!!! tag is alphanumeric label, fuck !!!!!

附上undionly.kpxe:undionly.kpxe


Dropbear配置SSH服务
2022年获得的证书
comments powered by Disqus