KVM host doesn't pass traffic to guest after a reboot

Issues related to configuring your network
Post Reply
bkeep
Posts: 2
Joined: 2013/12/30 08:06:00

KVM host doesn't pass traffic to guest after a reboot

Post by bkeep » 2019/12/23 23:14:33

I have a KVM host running with one guest ATM where everything works okay until the host is rebooted. After the host is rebooted, the guest cannot ping the local gateway or public nodes, nor can other machines communicate with it until I manually run nmcli con up VM_Network on the host. This also works if I run run nmcli con up team0. After running the con up command, the guest is fully accessible to all local machines and it can communicate with resources on the internet again.

After a host reboot, the host can ping 8.8.8.8 and can also ping the guest at 192.168.0.2. The guest can ping the host address of 192.168.0.100 but not the GW at 192.168.0.1 until the nmcli con up command has been run.

The guest provides DNS/DHCP/NTP for the internal network and is setup to use bridged networking on the host, which is configured using a team.

Networking:

Code: Select all

2 teamed NICs: main VM networking and access to the host itself.
  VM_Network (bridge)
    team0
      NIC1 (enp6s0f0)
      NIC2 (enp6s0f1)
# nmcli device status

Code: Select all

DEVICE      TYPE      STATE        CONNECTION 
VM_Network  bridge    connected    VM_Network 
SpanPorts   bridge    connected    SpanPorts  
virbr0      bridge    connected    virbr0     
enp6s0f0    ethernet  connected    enp6s0f0   
enp7s0f1    ethernet  connected    enp7s0f1   
team0       team      connected    team0      
vnet0       tun       connected    vnet0      
enp6s0f1    ethernet  unavailable  --         
enp7s0f0    ethernet  unavailable  --         
lo          loopback  unmanaged    --         
virbr0-nic  tun       unmanaged    -- 
# cat /etc/sysconfig/network-scripts/ifcfg-enp6s0f0

Code: Select all

NAME=enp6s0f0
UUID=e5ec9012-ee30-4739-8c2e-785fea03543d
DEVICE=enp6s0f0
ONBOOT=yes
TEAM_MASTER=team0
DEVICETYPE=TeamPort
# cat /etc/sysconfig/network-scripts/ifcfg-enp6s0f1

Code: Select all

NAME=enp6s0f1
UUID=8571dcad-e0d1-4baa-bbe8-3f692daead39
DEVICE=enp6s0f1
ONBOOT=yes
TEAM_MASTER=team0
DEVICETYPE=TeamPort
# cat /etc/sysconfig/network-scripts/ifcfg-team0

Code: Select all

TEAM_CONFIG="{\"runner\": {\"name\": \"loadbalance\", \"tx_hash\": [\"eth\", \"ipv4\", \"ipv6\"]}, \"link_watch\": {\"name\": \"ethtool\"}}"
PROXY_METHOD=none
BROWSER_ONLY=no
IPV4_FAILURE_FATAL=no
NAME=team0
UUID=4e400029-0bd7-437c-adf7-3b2e4858d314
DEVICE=team0
ONBOOT=yes
AUTOCONNECT_SLAVES=yes
DEVICETYPE=Team
BRIDGE=VM_Network
# cat /etc/sysconfig/network-scripts/ifcfg-VM_Network

Code: Select all

STP=no
TYPE=Bridge
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
IPADDR=192.168.0.100
PREFIX=24
GATEWAY=192.168.0.1
DNS1=192.168.0.2
DOMAIN=home.local
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=VM_Network
UUID=44b0c9af-0255-4569-85b4-93122d20180e
DEVICE=VM_Network
ONBOOT=yes
AUTOCONNECT_SLAVES=yes
Since this configuration seems to work after running the con up command, the easiest solution is to run nmcli con up team0 after all the networks have started but maybe there is something else worth checking? At this point, I have a systemd unit file running the command, however, this feels like a kludge.

# cat /etc/systemd/system/teamup@.service

Code: Select all

[Unit]
Description=Run nmcli up command for %i
After=network.target

[Service]
Type=oneshot
ExecStart=nmcli con up %i
RemainAfterExit=true

[Install]
WantedBy=multi-user.target
enabled by systemctl enable --now teamup@team0

Given that my problem is more of an annoyance then a real issue, is there a better way to handle the connectivity issues or something else I can check to verify what is actually the problem? While my solution works, I just think something else may be the actual fix vs. a quick and dirty workaround.

Post Reply

Return to “CentOS 8 - Networking Support”