PVE 的虚拟网卡是如何设计的

2023-02-20 10:01:00 +08:00
 PowerDi

惯性思维: VM 中,虚拟机的网络可以选择桥接模式,可以通过宿主机的网卡自动分配一个与宿主机网络同网段的 IP 地址,此时相当于一个网卡下面有两个独立的设备,一个宿主机一个虚拟机,路由器中也能看到。 在 PVE 中: 1 )我用的是无线网卡,配置自动生成的 vmbr0 才能连通 PVE 管理页面

auto wlp3s0
iface wlp3s0 inet static
        wpa-ssid "...."
        wpa-psk  ...       
        address 192.168.0.124/24
        gateway 192.168.0.1

auto vmbr0
iface vmbr0 inet static
        address  203.12.1.3/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0

如果我改成

auto wlp3s0
iface wlp3s0 inet dhcp
        wpa-ssid "..."
        wpa-psk  ...       

auto vmbr0
iface vmbr0 inet static
		address 192.168.0.124/24
        gateway 192.168.0.1
        bridge-ports wlp3s0
        bridge-stp off
        bridge-fd 0

这样就联不通 PVE 了。vmbr0 和管理页面是啥关系?

2 )其实最终的目的是为了虚拟机选择 vmbr0 网口时,能生成一个基于路由器网段的 IP ,这样我就能用路由器的端口转发到这台虚拟机上了

1045 次点击
所在节点    问与答
2 条回复
ho121
2023-02-20 10:16:39 +08:00
不太懂 PVE ,不过 libvirt 桥接到 wlan 是不支持的

Important Note: Unfortunately, wireless interfaces cannot be attached to a Linux host bridge, so if your connection to the external network is via a wireless interface ("wlanX"), you will not be able to use this mode of networking for your guests.

https://wiki.libvirt.org/page/Networking
kaedeair
2023-02-20 10:20:29 +08:00
vmbr0 是 pve 的管理页面接口,和路由器的 br-lan 差不多

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/917510

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX