0

I currently have a Centos 7 KVM host with the following network config:

[root@workhorse1 log]# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master vb2 state UP group default qlen 1000
    link/ether 00:21:9b:9d:75:07 brd ff:ff:ff:ff:ff:ff
3: em2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq master vb1 state DOWN group default qlen 1000
    link/ether 00:21:9b:9d:75:09 brd ff:ff:ff:ff:ff:ff
4: em3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:21:9b:9d:75:0b brd ff:ff:ff:ff:ff:ff
5: em4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:21:9b:9d:75:0d brd ff:ff:ff:ff:ff:ff
10: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:bf:c6:48 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
11: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:bf:c6:48 brd ff:ff:ff:ff:ff:ff
16: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master vb1 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:f8:58:d1 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fef8:58d1/64 scope link
       valid_lft forever preferred_lft forever
17: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master vb2 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:16:6f:bc brd ff:ff:ff:ff:ff:ff
18: vnet2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master vb3 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:de:07:95 brd ff:ff:ff:ff:ff:ff
19: vnet3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master vb4 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:7e:d9:ac brd ff:ff:ff:ff:ff:ff
20: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 62:30:db:db:51:bd brd ff:ff:ff:ff:ff:ff
27: vi2@vi1: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop master vb3 state DOWN group default qlen 1000
    link/ether 72:82:e9:ed:08:e8 brd ff:ff:ff:ff:ff:ff
28: vi1@vi2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether de:3c:55:e8:61:2e brd ff:ff:ff:ff:ff:ff
    inet 172.16.0.3/24 scope global vi1
       valid_lft forever preferred_lft forever
29: vi4@vi3: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop master vb4 state DOWN group default qlen 1000
    link/ether 3e:7c:e9:96:b9:a5 brd ff:ff:ff:ff:ff:ff
30: vi3@vi4: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 9a:6d:01:d6:70:ea brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.3/24 scope global vi3
       valid_lft forever preferred_lft forever
31: vb2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:21:9b:9d:75:07 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.16/24 brd 192.168.1.255 scope global noprefixroute vb2
       valid_lft forever preferred_lft forever
    inet6 fe80::221:9bff:fe9d:7507/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
32: vb1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:21:9b:9d:75:09 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::221:9bff:fe9d:7509/64 scope link
       valid_lft forever preferred_lft forever
33: vb3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 72:82:e9:ed:08:e8 brd ff:ff:ff:ff:ff:ff
    inet 172.16.0.2/24 brd 172.16.0.255 scope global noprefixroute vb3
       valid_lft forever preferred_lft forever
    inet6 fe80::7082:e9ff:feed:8e8/64 scope link
       valid_lft forever preferred_lft forever
34: vb4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 3e:7c:e9:96:b9:a5 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.2/24 brd 10.0.0.255 scope global noprefixroute vb4
       valid_lft forever preferred_lft forever
    inet6 fe80::3c7c:e9ff:fe96:b9a5/64 scope link
       valid_lft forever preferred_lft forever

[root@workhorse1 log]# brctl show
bridge name     bridge id               STP enabled     interfaces
vb1             8000.00219b9d7509       yes             em2
                                                        vnet0
vb2             8000.00219b9d7507       no              em1
                                                        vnet1
vb3             8000.7282e9ed08e8       yes             vi2
                                                        vnet2
vb4             8000.3e7ce996b9a5       yes             vi4
                                                        vnet3
virbr0          8000.525400bfc648       yes             virbr0-nic

 <interface type='bridge'>
      <mac address='52:54:00:f8:58:d1'/>
      <source bridge='vb1'/>
      <target dev='vnet0'/>
      <model type='e1000'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='bridge'>
      <mac address='52:54:00:16:6f:bc'/>
      <source bridge='vb2'/>
      <target dev='vnet1'/>
      <model type='e1000'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>
    <interface type='bridge'>
      <mac address='52:54:00:de:07:95'/>
      <source bridge='vb3'/>
      <target dev='vnet2'/>
      <model type='e1000'/>
      <alias name='net2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </interface>
    <interface type='bridge'>
      <mac address='52:54:00:7e:d9:ac'/>
      <source bridge='vb4'/>
      <target dev='vnet3'/>
      <model type='e1000'/>
      <alias name='net3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </interface>

When I systemctl restart network, the bridge enslavements for the virtual interfaces (vi1, vi2, vnet0-vnet3) don't persist and I have to re-enslave each virtual interface. I am enslaving the the virtual interfaces with ip link set vnet3 master vb4.

How do I make the virtual interface bridge enslavements persist between service and machine restarts?

  • how did create bridges v1,vb2 ? – EchoMike444 Mar 24 at 4:25
  • I created the ifcfg-vb1, ifcfg-vb2, ifcfg-vb3, and ifcfg-vb4 files under /etc/sysconfig/network-scripts/ – Alex Mar 24 at 4:35
  • vnetX are created by your virtualization software ? can you dump a example of one vm configuration with the command ` virsh dumpxml <VMNAME> ` – EchoMike444 Mar 24 at 4:40
  • Why you need to do systemctl restart network ? – EchoMike444 Mar 24 at 4:43
  • yes. I used virt-install to connect vb1-vb4 to the guest – Alex Mar 24 at 4:44
0

When you did your systemctl restart network, it cleared all your network configuration . This action brought down , all bridges you created and restarted all .

You must know , that after starting a VM , libvirtd do not monitoring the network .

Because of this, you was forced to re-associate some net interfaces .

You must test a restart of all yours VM, and if this is OK , you can restart your server .

  • Ok, I didnt know that libvirtd behaved that way. Thank you for clarifying this. – Alex Mar 24 at 5:21
  • Additionally, I was going down the wrong path with the veth interfaces in the first place. I am going to re-create vb3 and vb4 with docker and let dockerd manage the veths. – Alex Mar 24 at 5:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.