Restarting the networking on the HOST makes GUEST lose connection

7,524

I remember noticing this on here before and the answer appears to be that:

when you restart the networking, the vnetX tap devices are not reconnected, causing the VMs to lose connectivity with the bridge

With one solution and some workarounds proposed.

KVM guests lose connectivity after networking restart

Share:
7,524

Related videos on Youtube

Paul Kremser
Author by

Paul Kremser

Updated on September 18, 2022

Comments

  • Paul Kremser
    Paul Kremser almost 2 years

    I am probably missing something but have a KVM virtualized HOST/GUEST setup.

    • The GUEST is using a bridge (br0) on the HOST for internet connectivity.
    • When I make a "/etc/init.d/networking stop ; sleep 5 ; /etc/init.d/networking start" on the HOST the GUEST loses internet connectivity. -- When I reboot the HOST instead of doing a networking stop/start" then the GUEST is ok.

    NOTE: Tried also "ifdown br0 ; sleep 5 ; ifup br0", GUEST always loses connectivity still Surely i'm missing something here that is not working either on the restart or to do with libvirt, but what?

    Thanks in advance.

  • Paul Kremser
    Paul Kremser almost 10 years
    Thank you very much, you have pointed me in the right direction, in the end i decided to manually reconnect the vnet to the bridge which in my case was to perform the following command after the networking restart: brctl add if br0 vnet0
  • fqxp
    fqxp over 8 years
    There is a typo in @Onitlikesonic's answer: It should read brctl addif br0 vnet0.