PVE网络主备模式、VLAN配置、Interfaces配置参考

主备模式
创建bond
从属:参与主备的网卡,空格进行分隔
模式:active-backup是主备模式
bond-primary:主网卡

2025-09-18_153415.png

VLAN
1. 为桥接网卡设置桥接的物理网卡或者bond
2. 为桥接网卡配置VLAN,如vmbr0配置VLAN2就是创建Linux VLAN,名称为vmbr0.2
3. 新建Linux Bridge,与上一步创建的Linux VLAN进行桥接,如新建的Linux Bridge名称为vlan2
4. 为虚拟机分配桥接网络时使用vlan2

2025-09-18_161157.png

Interfaces配置参考
/etc/network/interfaces

初始配置

auto lo
iface lo inet loopback

auto eno1
iface eno1 inet manual

auto eno2
iface eno2 inet manual

auto eno3
iface eno3 inet manual

auto eno4
iface eno4 inet manual

auto enp131s0f0
iface enp131s0f0 inet manual

auto enp131s0f1
iface enp131s0f1 inet manual

auto enp131s0f2
iface enp131s0f2 inet manual

auto enp131s0f3
iface enp131s0f3 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.31.25/24
        gateway 192.168.31.1
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0

source /etc/network/interfaces.d/*

配置链路聚合、VLAN

auto lo
iface lo inet loopback

auto eno1
iface eno1 inet manual

auto eno2
iface eno2 inet manual

auto eno3
iface eno3 inet manual

auto eno4
iface eno4 inet manual

auto enp131s0f0
iface enp131s0f0 inet manual

auto enp131s0f1
iface enp131s0f1 inet manual

auto enp131s0f2
iface enp131s0f2 inet manual

auto enp131s0f3
iface enp131s0f3 inet manual

auto bond0
iface bond0 inet static
        address 192.168.31.24/24
        gateway 192.168.31.1
        bond-slaves eno1 enp131s0f0
        bond-miimon 100
        bond-mode 802.3ad

auto bond1
iface bond1 inet manual
        bond-slaves eno2 enp131s0f1
        bond-miimon 100
        bond-mode 802.3ad

auto vmbr0
iface vmbr0 inet manual
        bridge-ports bond1
        bridge-stp off
        bridge-fd 0

auto vmbr0.31
iface vmbr0.31 inet manual

auto vlan31
iface vlan31 inet manual
        bridge-ports vmbr0.31
        bridge-stp off
        bridge-fd 0

auto vmbr0.82
iface vmbr0.82 inet manual

auto vlan82
iface vlan82 inet manual
        bridge-ports vmbr0.82
        bridge-stp off
        bridge-fd 0

source /etc/network/interfaces.d/*