libvirt - virbr0 - setting the IP address

21,682

The proper way fo changing address is using virsh. You can stop network (e.g. ifdown):

virsh net-destroy default

And you can start it with:

virsh net-start default

As you edited default.xml file this should be enough. But for editing you can use:

virsh net-edit default
Share:
21,682

Related videos on Youtube

Samnang UdamPhagna
Author by

Samnang UdamPhagna

Updated on September 18, 2022

Comments

  • Samnang UdamPhagna
    Samnang UdamPhagna almost 2 years

    I am having issues with setting the IP address of the virbr0 interface created by libvirtd. I have configured a different IP in the xml file that configures networking (or so I thought), but it still defaults to 192.168.124.1. I did a grep through /etc and didn't find any matches.

    Where is this coming from? I'd like to have it specified to whatever I want so my firewall can allow for it.

  • Samnang UdamPhagna
    Samnang UdamPhagna over 9 years
    Even though I edited the right file, it appears there must be a cached file somewhere else with the original value. I'll use those commands to make the edits. I think I probably just need to destroy the network configuration, overlay my file, then start it.
  • taliezin
    taliezin over 9 years
    Also you can point a file to create network: virsh net-create /etc/libvirt/qemu/networks/default.xml. But you can check options with virsh help.
  • BradChesney79
    BradChesney79 about 3 years
    @taliezin using virsh net-destroy default, editing the file directly with vi with the file path you specified (although, I think virsh net-edit default does the same thing), then virsh net-create as you gave it worked for me. Thanks.