首先,我正在尝试在 Ubuntu Server 18.04.2 上执行此操作,它是我的 Win10 机器上的 VirtualBox 客户机。
好的,在我的 Ubuntu 客户机上,我尝试为 enp0s3(用于 Internet 访问的 VirtualBox 桥接接口)和 enp0s8(VirtualBox 内部网络)创建一个桥接接口,以便我可以与 KVM 客户机共享这些接口(我正在 VirtualBox 客户机内设置 OpenNebula 环境)。这是我的原来的/etc/netplan/50-cloud-init.yaml:
network:
ethernets:
enp0s3:
dhcp4: yes
enp0s8:
addresses: [192.168.1.55/24]
version: 2
这是我的修改的/etc/netplan/50-cloud-init.yaml:
network:
ethernets:
enp0s3:
dhcp4: no
dhcp6: no
enp0s8:
dhcp4: no
dhcp6: no
version: 2
bridges:
br0:
dhcp4: yes
interfaces: [enp0s3]
br1:
interfaces: [enp0s8]
addresses: [192.168.1.55/24]
但是,现在我无法通过任何接口进行连接。这是我的ifconfig
后续情况:
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::7cec:e4ff:fe4d:a771 prefixlen 64 scopeid 0x20<link>
ether 7e:ec:e4:4d:a7:71 txqueuelen 1000 (Ethernet)
RX packets 34 bytes 3446 (3.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 31 bytes 4006 (4.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.55 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::346a:7cff:fe9d:5e1d prefixlen 64 scopeid 0x20<link>
ether 36:6a:7c:9d:5e:1d txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10 bytes 816 (816.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 08:00:27:f6:23:e6 txqueuelen 1000 (Ethernet)
RX packets 1428 bytes 88862 (88.8 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 47 bytes 5758 (5.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 08:00:27:f5:dd:a4 txqueuelen 1000 (Ethernet)
RX packets 1 bytes 70 (70.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 23 bytes 2036 (2.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
brctl show
:
bridge name bridge id STP enabled interfaces
br0 8000.7eece44da771 no enp0s3
br1 8000.366a7c9d5e1d no enp0s8
virbr0 8000.52540093a24a yes virbr0-nic
我做错了什么?为什么 enp0s3 没有获取 IP,为什么我无法与 192.168.1.0/24 (enp0s8) 网络通信?