use of /etc/init.d/networking retart - Now Guests have no network access

greavette

Renowned Member
Apr 13, 2012
163
9
83
Hello,

I foolishly issued the command /etc/init.d/networking restart on my Proxmox server and now all my Guests have no network access. All Guests are using vmbr0 (connected to eth0). I can still access my webpage (which is the IP in vmbr0). I was working on setting up vmbr1, vmbr2 and vmbr4 when I thought I could restart my network interfaces with the networking restart command.

I know I could restart my Server, but before I do I'm backing up my guests first (just to be safe). So as I sit here waiting for my guests to backup and copy off my server I'm wondering...why would issuing this command make all my Guest loose their network access? And by issuing this command have I done something seriously wrong to my Proxmox server whereupon a restart will not fix it?

Is there a way to fix this without a restart?

In case it helps...here is the contents of my interfaces file:

Code:
# network interface settings
auto lo
iface lo inet loopback


iface eth0 inet manual


iface eth1 inet manual


iface eth2 inet manual


iface eth3 inet manual


auto vmbr0
iface vmbr0 inet static
        address  192.168.10.9
        netmask  255.255.255.0
        gateway  192.168.10.1
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0


auto vmbr4
iface vmbr4 inet manual
        bridge_ports eth3
        bridge_stp off
        bridge_fd 0


auto vmbr1
iface vmbr1 inet manual
        bridge_ports eth1
        bridge_stp off
        bridge_fd 0


auto vmbr2
iface vmbr2 inet manual
        bridge_ports eth2
        bridge_stp off
        bridge_fd 0
 
So I've restarted my Host Server now. Everything came back fine and my Guests can connect again. But I'm curious why this happened. Is rebooting the server the only solution if this ever happens again (not that I'll be issuing this command again) but if my Guests for some reason loose connectivity I mean.

Thank you.
 
Hi,
do an "brctl show" now and if you have done a restart network. I guess your tap-interfaces of the VM-guests are not connected to an bridge.
If this happens (and you know which tap is on which bridge) you can add the device again with "brctl addif vmbr0 tap100i0".

Udo
 
I learnt this after applying a network change I made in the GUI that I didn't want to restart the host for. I confirmed that after a full network restart (/etc/init.d/networking restart) as you did, the entire networking system comes back up fine. It requires a power cycle of the guest(s) to reactivate the network for them though. This must be a shutdown, then startup, not a restart...I think the hypervisor needs to disconnect them from the "old" bridge interface, and reconnect them to the "new" bridge interface. Even if they are the same (at least, they were on my end), there must be something lower level on the bridges that changes when the networking system is stopped / started again. It's painful to have to restart all the guests like this, but usually better than restarting the host for us.
 
Here is a free script for you to use:

Code:
#!/bin/bash
PATH=/usr/sbin:/usr/bin

restartvm() {
    VMS=$(qm list |awk '/running/ {print $1}')
    for vm in $VMS; do
        echo Restarting $vm
        qm stop $vm
        qm start $vm
    done;
}

restartct() {
    VZS=$(vzlist |awk '/running/ {print $1}')
    for vz in $VZS; do
        echo Restarting $vz
        vzctl stop $vz
        vzctl start $vz
    done;
}

case $1 in
    -vm|-VM)
        restartvm
    ;;
    -ct|-CT)
        restartct
    ;;
    -all)
        restartvm
        restartct
    ;;
    *)
        echo usage $0 [OPTIONS]
        echo
        echo OPTIONS
        echo "-vm     All running VM's"
        echo "-ct     All running CT's"
    ;;
esac
 
Last edited:
I just run into that problem.

Before restarting host network I have:
root@proxmox:~# brctl show
bridge name bridge id STP enabled interfaces
vmbr0 8000.0800276d3238 no eth0
veth100.0
vmbr1 8000.080027336398 no eth1
veth101.0

after restarting:
root@proxmox:~# brctl show
bridge name bridge id STP enabled interfaces
vmbr0 8000.0800276d3238 no eth0
vmbr1 8000.080027336398 no eth1

I simply edited /etc/network/interfaces adding veth100.0 and veth101.0 to correct bridges (You can check which one is which in guest network tab).

Example:
# network interface settings
auto lo
iface lo inet loopback

iface eth0 inet manual

iface eth1 inet manual

auto vmbr0
iface vmbr0 inet static
address xxx.xxx.xxx.xxx
netmask 255.255.255.128
gateway xxx.xxx.xxx.xxx
bridge_ports eth0 veth100.0
bridge_stp off
bridge_fd 0

auto vmbr1
iface vmbr1 inet static
address 10.0.0.2
netmask 255.255.255.0
bridge_ports eth1 veth101.0
bridge_stp off
bridge_fd 0

and now after restart guest don't lose network.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!