工作特點(diǎn):
無需協(xié)議協(xié)商:交換機(jī)不運(yùn)行LACP,只是簡單地將多個(gè)端口捆綁
輪詢發(fā)送:服務(wù)器按順序輪流使用eth0、eth1發(fā)送數(shù)據(jù)包
任意接收:兩個(gè)端口都可以接收數(shù)據(jù),但可能產(chǎn)生亂序問題
MAC地址:bond0使用其中一個(gè)物理接口的MAC(可能是eth0的)
服務(wù)器 (bond0, mode=0) ? 交換機(jī) (Eth-Trunk1)
├─ eth0 (10G) ──────────── 10GE1/0/1
└─ eth1 (10G) ──────────── 10GE2/0/1
模式:靜態(tài)鏈路聚合(無協(xié)議協(xié)商)
協(xié)議:無(純二層捆綁)
特點(diǎn):簡單、穩(wěn)定、兼容性好
# 交換機(jī)應(yīng)該配置為:
interface Eth-Trunk1
port link-type hybrid
port hybrid pvid vlan 100
port hybrid tagged van 200 2001
port hybrid untagged vlan 2 to 199 201 to 2000 2002 to 4094
#
interface 10GE1/0/1
eth-trunk 1
device transceiver 10GBASE-FIBER
#
interface 10GE2/0/1
eth-trunk 1
device transceiver 10GBASE-FIBER
cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 6c:92:bf:67:01:9e
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 6c:92:bf:67:01:9f
Slave queue ID: 0
[root@lvsc]# ip -d link show bond0.200
15: bond0.200@bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 6:9:bf:67:01:9c brd ff:ff:ff:ff:ff:ff
vlan id 200 <REORDER_HDR>
[root@lvsc]# ip -d link show bond0
8: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 6:9:bf:67:01:9c brd ff:ff:ff:ff:ff:ff
┌─────────────────┐ ┌─────────────────┐
│ 服務(wù)器 │ │ 交換機(jī) │
│ │ │ │
│ bond0 │ 邏輯鏈路 │ Eth-Trunk1 │
│ (mode=0) │?───────────?│ (static) │
│ │ │ │ │ │ │ │
│ eth0 eth1 │ 物理鏈路 │10GE1/0/1 10GE2/0/1│
│ │ │ │ │ │ │ │
└────┼────┼───────┘ └────┼────┼───────┘
│ │ │ │
└────┴───────────────────────────┴────┘
兩條10G鏈路 → 20G邏輯帶寬
數(shù)據(jù)流:服務(wù)器輪詢發(fā)送 → 交換機(jī)根據(jù)MAC/IP哈希接收
ip route-static 0.0.0.0 0.0.0.0 上游網(wǎng)關(guān) # 默認(rèn)路由到ISP
ip route-static 192.168.32.0 24 Vlanif200 # 內(nèi)網(wǎng)路由
路由匹配的黃金法則-最長匹配原則:路由器總是選擇最精確的匹配,即子網(wǎng)掩碼最長(前綴長度最大)的路由。
Linux服務(wù)器同樣遵循"最長匹配原則"!
測試路由決策:ip route get 192.168.32.100