工作特点:
无需协议协商:交换机不运行LACP,只是简单地将多个端口捆绑
轮询发送:服务器按顺序轮流使用eth0、eth1发送数据包
任意接收:两个端口都可以接收数据,但可能产生乱序问题
MAC地址:bond0使用其中一个物理接口的MAC(可能是eth0的)
服务器 (bond0, mode=0) ↔ 交换机 (Eth-Trunk1)
├─ eth0 (10G) ──────────── 10GE1/0/1
└─ eth1 (10G) ──────────── 10GE2/0/1
模式:静态链路聚合(无协议协商)
协议:无(纯二层捆绑)
特点:简单、稳定、兼容性好
# 交换机应该配置为:
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
┌─────────────────┐ ┌─────────────────┐
│ 服务器 │ │ 交换机 │
│ │ │ │
│ bond0 │ 逻辑链路 │ Eth-Trunk1 │
│ (mode=0) │◄───────────►│ (static) │
│ │ │ │ │ │ │ │
│ eth0 eth1 │ 物理链路 │10GE1/0/1 10GE2/0/1│
│ │ │ │ │ │ │ │
└────┼────┼───────┘ └────┼────┼───────┘
│ │ │ │
└────┴───────────────────────────┴────┘
两条10G链路 → 20G逻辑带宽
数据流:服务器轮询发送 → 交换机根据MAC/IP哈希接收
ip route-static 0.0.0.0 0.0.0.0 上游网关 # 默认路由到ISP
ip route-static 192.168.32.0 24 Vlanif200 # 内网路由
路由匹配的黄金法则-最长匹配原则:路由器总是选择最精确的匹配,即子网掩码最长(前缀长度最大)的路由。
Linux服务器同样遵循"最长匹配原则"!
测试路由决策:ip route get 192.168.32.100