mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
network: Generate TFTP config regardless of DHCP
We already allow users to provide TFTP root path in network XML and not specify any DHCP. This makes sense, because dnsmasq is not only DHCP server but also TFTP server and users might have a DHCP server configured on their own, outside of libvirt's control and want just the TFTP part. By moving TFTP config generator out of DHCP generator and calling it for every IPv4 range, users can finally enable just TFTP. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2026765 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
@@ -10,11 +10,11 @@ expand-hosts
|
||||
except-interface=lo
|
||||
bind-dynamic
|
||||
interface=virbr1
|
||||
enable-tftp
|
||||
tftp-root=/var/lib/tftproot
|
||||
dhcp-range=192.168.122.2,192.168.122.254,255.255.255.0
|
||||
dhcp-no-override
|
||||
dhcp-authoritative
|
||||
enable-tftp
|
||||
tftp-root=/var/lib/tftproot
|
||||
dhcp-boot=pxeboot.img
|
||||
dhcp-lease-max=253
|
||||
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/netboot.hostsfile
|
||||
|
||||
13
tests/networkxml2confdata/netboot-tftp.conf
Normal file
13
tests/networkxml2confdata/netboot-tftp.conf
Normal file
@@ -0,0 +1,13 @@
|
||||
##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
|
||||
##OVERWRITTEN AND LOST. Changes to this configuration should be made using:
|
||||
## virsh net-edit tftp-only
|
||||
## or other application using the libvirt API.
|
||||
##
|
||||
## dnsmasq conf file created by libvirt
|
||||
strict-order
|
||||
except-interface=lo
|
||||
bind-dynamic
|
||||
interface=virbr0
|
||||
enable-tftp
|
||||
tftp-root=/var/lib/tftproot
|
||||
addn-hosts=/var/lib/libvirt/dnsmasq/tftp-only.addnhosts
|
||||
9
tests/networkxml2confdata/netboot-tftp.xml
Normal file
9
tests/networkxml2confdata/netboot-tftp.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<network>
|
||||
<name>tftp-only</name>
|
||||
<uuid>eb486e5c-4df5-42ee-ae4a-ad8557998d00</uuid>
|
||||
<forward mode='nat'/>
|
||||
<bridge name='virbr0' stp='off' delay='1'/>
|
||||
<ip address='192.168.122.1' netmask='255.255.255.0'>
|
||||
<tftp root='/var/lib/tftproot'/>
|
||||
</ip>
|
||||
</network>
|
||||
Reference in New Issue
Block a user