Statically Defining a Network
by richard.schmitt@starlab.io
We install libvirt in a AlmaLinux 9 Kickstart file. The version of libvirt we are using is 10.0.0.
What we'd like to do is to statically define a network in the kickstart file without having to run `virsh net-define`. In other words, we had hoped that by installing a <network>.xml file in /usr/share/libvirt/networks, that that network would be recognized by libvirt the first time the system is booted. This does not appear to be the case.
Is there a way to statically define libvirt networks without needing to run 'virsh net-define'?
Thanks
5 months, 1 week
Re: Guests: Unable to get IP address
by Michal Prívozník
Please keep the list on CC so that others can benefit from the
conversation too.
On 5/21/24 14:34, Arun Mani J wrote:
> Thanks for the reply!
>
> I recreated the NAT network using the guide from https://wiki.libvirt.org/Networking.html.
>
> The configuration now reads as:
> <network>
> <name>default</name>
> <uuid>33376669-6292-44c9-b26b-9d2ee69826a7</uuid>
> <forward mode="nat">
> <nat>
> <port start="1024" end="65535"/>
> </nat>
> </forward>
> <bridge name="virbr0" stp="on" delay="0"/>
> <mac address="52:54:00:78:76:0f"/>
> <ip address="192.168.122.1" netmask="255.255.255.0">
> <dhcp>
> <range start="192.168.122.2" end="192.168.122.254"/>
> </dhcp>
> </ip>
> </network>
>
> There is a dhcp section but still I'm not able to get my guest working.
>
> I have dnsmasq-base package installed in my host. However I'm not sure how to see if that is running. Like I opened Systems Monitor and can't find any process with that name.
>
> So may be that's the problem?
Well, have you restarted the network? You need the 'virsh net-destroy
default && virsh net-start default' combo to restart it. After that you
should see dnsmasq process, e.g. via 'ps axf | grep dnsmasq'.
Michal
5 months, 2 weeks