我刚刚安装了带有 Ubuntu 20.04(最小,无 GUI)的新服务器。我有 2 个以太网卡,带有 2 个公共 IP。用每根电缆连接每个网卡。我想使用 virt-install 创建虚拟机,我在这里找到了该指南:
https://www.linuxtechi.com/install-kvm-on-ubuntu-20-04-lts-server/
这是我的 00-installer-config.yaml
network:
ethernets:
enp3s0:
dhcp4: no
addresses: [123.123.123.123/32]
nameservers:
addresses: [8.8.8.8,8.8.4.4]
routes:
- to: 0.0.0.0/0
via: 12.12.12.12
on-link: true
enp6s0:
dhcp4: no
addresses: [111.111.111.111/32]
nameservers:
addresses: [8.8.8.8,8.8.4.4]
routes:
- to: 0.0.0.0/0
via: 11.11.11.11
on-link: true
version: 2
我想让 enp3s0 被主机使用,而 enp6s0 被我的虚拟机使用。
我尝试这样设置
network:
ethernets:
enp3s0:
dhcp4: no
addresses: [103.77.78.198/32]
nameservers:
addresses: [8.8.8.8,8.8.4.4]
routes:
- to: 0.0.0.0/0
via: 10.77.78.198
on-link: true
enp6s0:
dhcp4: no
bridges:
br0:
interfaces: [enp6s0]
addresses: [103.77.78.199/32]
nameservers:
addresses: [8.8.8.8,8.8.4.4]
routes:
- to: 0.0.0.0/0
via: 10.77.78.199
on-link: true
version: 2
我运行这个
virt-install -n node2 --description "VNODE2" --os-type=generic --ram=16384 --vcpus=4 --disk /dev/sdb --check all=off --network bridge:br0 --graphics none --location http://us.archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/ --extra-args='console=tty0 console=ttyS0,115200n8 serial'
不起作用。有办法解决这个问题吗?提前谢谢