作為序言,我嘗試在 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) 網路通訊?