mirror of
https://github.com/eblot/pybootd.git
synced 2024-09-11 22:17:44 +03:00
Adds set_gateway option
The DHCP gatewy option should not be set in cases in which the interface where pybootd is bound in not meant to act as the gateway for the host booted via PXE.
This commit is contained in:
parent
d4ad0a479d
commit
a62124c6a9
@ -15,6 +15,7 @@ access = mac
|
||||
allow_simple_dhcp = enable
|
||||
dns = 10.130.0.2
|
||||
boot_file = pxelinux.0
|
||||
set_gateway = true
|
||||
; use "nc -l -u 127.0.0.1 -p 12345" to debug
|
||||
; notify = 192.168.26.201:12345;192.168.26.200:12345
|
||||
|
||||
|
@ -544,7 +544,10 @@ class BootpServer:
|
||||
pkt += struct.pack('!BB4s', DHCP_SERVER, 4, server)
|
||||
mask = socket.inet_aton(self.netconfig['mask'])
|
||||
pkt += struct.pack('!BB4s', DHCP_IP_MASK, 4, mask)
|
||||
pkt += struct.pack('!BB4s', DHCP_IP_GATEWAY, 4, server)
|
||||
|
||||
if to_bool(self.config.get(self.bootp_section, 'set_gateway', True)):
|
||||
pkt += struct.pack('!BB4s', DHCP_IP_GATEWAY, 4, server)
|
||||
|
||||
dns = self.config.get(self.bootp_section,
|
||||
'dns', None)
|
||||
if dns:
|
||||
|
Loading…
Reference in New Issue
Block a user