2022年4月27日 星期三

Proxmox | 建立Bonding(LACP 802.3ad)與VLAN的網路架構

目標是把兩個Port bonding起來使用LACP(802.3ad),並在Bonding Port上跑多個VLAN。



步驟一:建立bonding port

到System -> Network -> Create -> Linux bond
Name : 第一個bonding port就取名為bond0
Slaves : 輸入要加入的網卡名稱
Mode : 這邊要配合Switch設定,這邊就是配合範例使用LACP
Hash policy : 分流的演算法,Layer2+3通常不錯


這步驟實際上應該先選一個網卡,因為目前連上PVE的網卡是被占用,可以建立好bond0後,確定可以連現在把舊的vmbr0給刪除。

步驟二:建立Linux Bridge

到System -> Network -> Create -> Linux Bridge
這邊取名為vmbr1,避免和原來vmbr0的衝突到,Bridge ports輸入步驟一的bond0,VLAN aware要打勾,意思是要不要帶VLAN Tag。




步驟三:建立Linux VLAN

到System -> Network -> Create -> Linux VLAN,名稱輸入步驟二命名的vmbr1.vlanid,如下我要建立一個Vlan ID是16的Vlan,所以輸入vmbr1.16,MTU如果有Storage網段可以考慮設定9000。



步驟四:點選Apply Configuration

Network都新增完後,點選Apply Configuration。


刪掉vmbr0後,完整的結果會長如下圖的樣子。



步驟五:設定Switch LACP

這邊就看各家Switch如何設定,Switch那邊的LACP要匹配步驟一的模式,也就是Active,然後VLAN要帶入與步驟三設定的Tag ID。


步驟六:驗證LACP是否成功


在PVE Shell輸入下面指令查看bond0狀態。
# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v5.13.19-2-pve

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2+3 (2)
MII Status: up #這個狀態顯示up代表LACP已成功建立
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0

802.3ad info
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
System priority: 65535
System MAC address: fa:be:c9:ca:a1:f9
Active Aggregator Info:
        Aggregator ID: 1
        Number of ports: 2
        Actor Key: 9
        Partner Key: 17
        Partner Mac Address: d4:76:a0:71:f1:63

Slave Interface: eno1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: ac:1f:6b:81:37:e8
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
    system priority: 65535
    system mac address: fa:be:c9:ca:a1:f9
    port key: 9
    port priority: 255
    port number: 1
    port state: 61
details partner lacp pdu:
    system priority: 65535
    system mac address: d4:76:a0:71:f1:63
    oper key: 17
    port priority: 255
    port number: 1
    port state: 61

Slave Interface: eno2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: ac:1f:6b:81:37:e9
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
details actor lacp pdu:
    system priority: 65535
    system mac address: fa:be:c9:ca:a1:f9
    port key: 9
    port priority: 255
    port number: 2
    port state: 61
details partner lacp pdu:
    system priority: 65535
    system mac address: d4:76:a0:71:f1:63
    oper key: 17
    port priority: 255
    port number: 2
    port state: 61

步驟七:驗證VLAN是否成功


這邊就是直接用步驟三設定好的Vlan IP去ping同網段的IP就知道有沒有成功。



參考:



沒有留言: