我正在尝试在 Ubuntu 服务器 18.04 中使用 Virtual Box 命令行创建 Ubuntu 服务器虚拟机。我遵循了以下步骤本网站. 桥接接口创建:
vmubuntu01: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.15.201 netmask 255.255.255.0 broadcast 192.168.15.255
inet6 fe80::d4c2:1bff:fe4f:7524 prefixlen 64 scopeid 0x20<link>
ether d6:c2:1b:4f:75:24 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1012 bytes 85102 (85.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
但是当我安装虚拟机时,它无法识别该界面:
答案1
网络计划
01-netcfg.yaml
更改您的接口名称、路由器地址和所需的静态 IP。就我而言,我的 ISP 路由器也搞乱了 DNS,因此我将 netplan 配置为直接执行 DNS(不使用路由器)
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
addresses:
- 192.168.1.200/24
gateway4: 192.168.1.1
dhcp4: true
dhcp6: true
dhcp4-overrides:
use-dns: false # https://netplan.io/reference don't use dhcp server (router) DNS
dhcp6-overrides:
use-dns: false
nameservers:
addresses: [8.8.8.8]
安装:
sudo ./01-netcfg.yaml /etc/netplan/.
sudo netplan apply