PVE双网卡桥接虚拟网络
原创2025年10月10日大约 3 分钟
PVE双网卡桥接虚拟网络
当前现状:PVE中有两个网卡,目前只使用其中一个网卡,供上网是试用,内部有个虚拟网络。现在想让另外一个网络卡也使用这个虚拟网络,并且可以正常上网,分配到虚拟网络的IP断。
环境信息
PVE版本信息
root@:~# pveversion -v
proxmox-ve: 8.3.0 (running kernel: 6.8.12-8-pve)
pve-manager: 8.3.4 (running version: 8.3.4/65224a0f9cd294a3)
proxmox-kernel-helper: 8.1.1
proxmox-kernel-6.8: 6.8.12-8当前网络配置
IP 和 网口匿名化处理了
root@:~# cat /etc/network/interfaces
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!
auto lo
iface lo inet loopback
iface wlpXXXs0 inet manual
iface enpXX0s0 inet manual
iface enpXX1s0 inet manual
auto vmbr0
iface vmbr0 inet static
address 192.XXX.X.XXX/24
gateway 192.XXX.X.1
bridge-ports enpXX0s0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 10.XXX.x.XXX/24
bridge-ports none
bridge-stp off
bridge-fd 0
root@mac-pro:~#要把 网口 enpXX1s0 当虚拟网络 vmbr1 也即 10.XXX.x.XXX/24使用 , 修改下面行配置
# bridge-ports none 改为
bridge-ports enpXX1s0
# 重启网络
systemctl restart networking.service注意事项,问题的解决方法
- 如果不能正确获取IP地址,请 重启
vmbr1网段中的openWrt虚拟机 - 如果不能上网,请移除,再加入
vmbr1网段中的openWrt虚拟机的硬件网卡vmbr1并再加入, 再重启openWrt虚拟机 - 如果其他虚拟机无法上网,请移除对应虚拟网卡
vmbr1,再加入, 再重启虚拟机 - 如果还不能上网,请重启PVE
最终的网络拓扑
展示不了请copy代码到能解析
mermaid的工具中查看
graph TD
%% =============================
%% 外部网络部分
%% =============================
Internet[🌐 互联网] --> Router[🏠 上级路由器<br>192.XXX.X.1]
%% =============================
%% PVE 主机和物理接口
%% =============================
Router -->|🖧 以太网线| enp1[🔌 PVE网口1 enp1s0]
subgraph PVE_HOST[🖥️ PVE 主机]
direction TB
enp1 --> vmbr0[🌉 外网桥 vmbr0<br>192.XXX.X.101]
enp2[🔌 PVE网口2 enp2s0] --> vmbr1[🌉 内网桥 vmbr1<br>10.XXX.X.100]
end
%% =============================
%% OpenWrt 路由部分
%% =============================
vmbr0 --> OpenWrt[🛡️ OpenWrt 软路由]
OpenWrt --> vmbr1
OpenWrt_Details[📡 OpenWrt IP配置<br>WAN: 192.XXX.X.102<br>LAN: 10.XXX.X.1]
OpenWrt --> OpenWrt_Details
%% =============================
%% 虚拟机网络
%% =============================
vmbr1 --> VM1[🐧 Ubuntu Server<br>10.XXX.X.101]
vmbr1 --> VM2[💻 Windows 10<br>10.XXX.X.102]
vmbr1 --> VM3[💻 Windows 11<br>10.XXX.X.103]
%% =============================
%% 物理机连接
%% =============================
enp2 -->|直连| WinPhysical[🖥️ Windows 物理机<br>10.XXX.X.104]
vmbr1 -.->|虚拟桥接| WinPhysical
%% =============================
%% 网络流向说明
%% =============================
Internet -.->|互联网接入| Router
Router -.->|DHCP & NAT| PVE_HOST
%% =============================
%% 样式定义
%% =============================
classDef internet fill:#B3E5FC,color:#000,stroke:#01579B,stroke-width:2px
classDef router fill:#FFECB3,color:#000,stroke:#FF6F00,stroke-width:2px
classDef pve fill:#C8E6C9,color:#000,stroke:#1B5E20,stroke-width:2px
classDef bridge fill:#E1BEE7,color:#000,stroke:#4A148C,stroke-width:2px
classDef openwrt fill:#FFCCBC,color:#000,stroke:#BF360C,stroke-width:2px
classDef linuxVM fill:#BBDEFB,color:#000,stroke:#0D47A1,stroke-width:2px
classDef windowsVM fill:#F8BBD0,color:#000,stroke:#880E4F,stroke-width:2px
classDef physical fill:#D7CCC8,color:#000,stroke:#3E2723,stroke-width:2px
class Internet internet
class Router router
class PVE_HOST,enp1,enp2 pve
class vmbr0,vmbr1 bridge
class OpenWrt,OpenWrt_Details openwrt
class VM1 linuxVM
class VM2,VM3 windowsVM
class WinPhysical physical