LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Cannot ping KVM machine from the host machine and vice-versa (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/cannot-ping-kvm-machine-from-the-host-machine-and-vice-versa-4175732202/)

Bazim 12-27-2023 04:13 PM

Cannot ping KVM machine from the host machine and vice-versa
 
Hello, I created a KVM Ubuntu Sever machine on a Ubuntu Server host machine.

Host is 192.168.0.110
KVM is 192.168.0.237
Home Assistant is 192.168.0.87 (also running on that host machine as KVM).

This is network setting via Cockpit Machines from the host machine:
Code:

Type: Direct attachment
Source: enp6s0
Model: virtio

In the KVM machine I set a bridge in /etc/netplan/ like this:
Code:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0:
      dhcp4: false
      dhcp6: false
  bridges:
    br0:
      dhcp4: true
      dhcp6: false
      macaddress: "52:54:00:ae:98:01"
      interfaces: [ enp1s0 ]

This is command ip a
Code:

2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether 52:54:00:ae:98:01 brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:54:00:ae:98:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.237/24 metric 100 brd 192.168.0.255 scope global dynamic br0
      valid_lft 86397sec preferred_lft 86397sec
    inet6 fd9d:209b:8334:730:5054:ff:feae:9801/64 scope global dynamic mngtmpaddr noprefixroute
      valid_lft 1799sec preferred_lft 1799sec
    inet6 fe80::5054:ff:feae:9801/64 scope link
      valid_lft forever preferred_lft forever

But I cannot ping from the host machine to KVM machine and vice-versa. Can you help me with that please?

c0wb0y 04-19-2024 10:36 PM

When you say you created a KVM Ubuntu Server, does it mean another hypervisor inside the host machine, so nested? Or, did you mean it's just another plain vm similar to Home Assistant? Were you using libvirt to spawn them? Libvirt's default network and its interface virbr0 is called NAT-mode. It creates firewall rules to match that.

I noticed that your IP address space is 192.168.0.0/24 in contrast to default 192.168.122.0/24 (not that there is anything wrong with that). I just wanted to make sure that it's not an issue of mismatched address space.

Please post the output of host's
Code:

ip -4 addr
as well. Also, stick tcpdump on the host's interface, then issue ping from the guests.


All times are GMT -5. The time now is 03:45 AM.