对于静态以太网接口(eno1
),我使用以下内容(cat /etc/network/interfaces
):
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#allow-hotplug eno1
#iface eno1 inet dhcp
# The bridge network interface
auto br0
iface br0 inet static
address 10.0.1.2
netmask 255.255.255.0
network 10.0.1.0
broadcast 10.0.1.255
gateway 10.0.1.1
bridge_ports eno1
bridge_stp off
bridge_fd 0
bridge_maxwait 0
dns-nameservers 1.1.1.1 1.0.0.1
wlp2s0
DHCP 无线接口( ,未插入电缆)的等效功能是什么eno1
?这是我到目前为止不使用桥接器进行连接的方式(cat /etc/network/interfaces
):
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eno1
iface eno1 inet dhcp
# The wireless network interfac
allow-hotplug wlp2s0
iface wlp2s0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
答案1
发现无法通过无线接口进行桥接,所以我最终使用了基于 NAT 的网络。
看https://jamielinux.com/docs/libvirt-networking-handbook/nat-based-network.html