Re: Network interface element not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 4/4/22 2:08 PM, Ian Pilcher wrote:
I've added an interface element to a libvirt network, but it isn't
working.  The interface is not being added to the bridge, even after the
system is rebooted.

That's not what the <interface> element in a <network> is used for. It's actual use is (in my opinion) not all that useful, which has led to people assuming other functionality for it that doesn't exist.

The *actual* use of the <interface> element is simply to add an extra iptables rule that will drop all traffic originating from a guest and outbound to the real network if the interface it uses for egress doesn't match the one listed in the <interface> element. It doesn't attach this egress interface to the network's bridge, and it doesn't modify the next-hop routing of the traffic (which is the more common mistaken belief of its function).

Anyway, if you want to have a bridge device that is directly attached to a physical ethernet, then you should set up a bridge in the host OS outside the scope of libvirt, with the physical ethernet attached to it, and then configure your libvirt guests to use that bridge with, e.g.

    <interface type='bridge'>
      <source bridge='br0'/>

# virsh net-dumpxml ocp4-net
   <forward dev='eno2' mode='nat'>
       <port start='1024' end='65535'/>
     <interface dev='eno2'/>
   <bridge name='virbr-ocp4' stp='on' delay='0'/>
   <mac address='52:54:00:99:99:99'/>
   <ip address='' netmask=''>

# brctl show
bridge name     bridge id               STP enabled     interfaces
virbr-ocp4              8000.525400999999       yes             vnet0
virbr0          8000.525400a7ce7f       yes
virbr1          8000.52540051eb1f       yes             vnet1

# rpm -q libvirt

Any ideas?

[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux