无法通过网桥 (netplan、qemu) 进行 ping 操作

无法通过网桥 (netplan、qemu) 进行 ping 操作

我无法 ping 通在 Ubuntu 18.04 中作为 qemu 客户机运行的虚拟映像。

默认的 yaml 文件/etc/netplan/是:

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: yes
      dhcp6: no

我为桥接接口添加了另一个 yaml 文件,如下所示本指南

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s25:
      dhcp4: true
  bridges:
    br0:
      addresses: [ 192.168.56.1/24 ]
      interfaces: [ vlan15 ]
  vlans:
    vlan15:
      accept-ra: no
      id: 15
      link: enp0s25

网桥已创建,但我无法 ping 通。以下是控制台上的输出:

PING 192.168.56.7 (192.168.56.7) 56(84) bytes of data.
From 192.168.56.1 icmp_seq=1 Destination Host Unreachable
From 192.168.56.1 icmp_seq=2 Destination Host Unreachable
From 192.168.56.1 icmp_seq=3 Destination Host Unreachable

--- 192.168.56.7 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2040ms
pipe 3

答案1

我得到了以下配置工作(仅.yaml使用一个文件):

network:
 version: 2
 renderer: networkd
 ethernets:
  eno1:
   dhcp4: yes
   dhcp6: no
  eno2: {}
 bridges:
  br0:
   addresses: [ 192.168.56.7/24 ]
   interfaces: [ vlan15]
 vlans:
  vlan15:
   accept-ra: no
   id: 15
   link: eno2

相关内容