Agregacja portów (static bonding) w OpenWrt
Sprzęt
Router: Fujitsu Futro S920
CPU: GX-424CC (4×2.4 GHz)
RAM: 8 GB
System: OpenWrt
Switch: TP-Link TL-SG108E (Static LAG, brak LACP)
Internet: eth0 → router Orange 1 Gb/s
Karty sieciowe:
01:00.0 Intel 82571EB
01:00.1 Intel 82571EB
02:00.0 Realtek RTL8111
Schemat sieci:
ROUTER (OpenWrt)
┌───────────────────┐
│ eth1 ─────┐ │
│ ├─ bond0 (agr)
│ eth2 ─────┘ │
└────────┬──────────┘
││ 2×1Gb
====================
││
┌────────▼▼─────────┐
│ SWITCH │
│ Static LAG │
│ port1 + port2 │
└───────────────────┘
Instalacja pakietu
opkg update
opkg install kmod-bonding
/etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdef:ba19:12aa::/48'
option packet_steering '0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option gateway '192.168.2.6'
list ipaddr '192.168.2.1/24'
list dns '194.204.159.1'
list dns '8.8.8.8'
list dns '1.1.1.1'
config device
option name 'br-lan'
option type 'bridge'
option bridge_empty '1'
option ipv6 '0'
list ports 'agr'
list ports 'eth0'
config device
option type 'bonding'
option name 'agr'
list ports 'eth1'
list ports 'eth2'
option policy 'balance-xor'
option mtu '1500'
option ipv6 '0'
Restart sieci
/etc/init.d/network restart
Sprawdzenie statusu bondingu
cat /proc/net/bonding/agr
Testy wydajności – iperf3 dwóch klientów jednocześnie
Klient 1 – Raspberry Pi
Wynik:
Connecting to host 192.168.2.1, port 5201
[ 5] local 192.168.2.2 port 38938 connected to 192.168.2.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 114 MBytes 959 Mbits/sec 0 274 KBytes
[ 5] 1.00-2.00 sec 111 MBytes 934 Mbits/sec 0 269 KBytes
[ 5] 2.00-3.00 sec 111 MBytes 933 Mbits/sec 0 272 KBytes
[ 5] 3.00-4.00 sec 112 MBytes 944 Mbits/sec 0 269 KBytes
[ 5] 4.00-5.00 sec 112 MBytes 938 Mbits/sec 0 266 KBytes
[ 5] 5.00-6.00 sec 112 MBytes 943 Mbits/sec 0 269 KBytes
[ 5] 6.00-7.00 sec 112 MBytes 935 Mbits/sec 0 272 KBytes
[ 5] 7.00-8.00 sec 113 MBytes 946 Mbits/sec 0 274 KBytes
[ 5] 8.00-9.00 sec 112 MBytes 940 Mbits/sec 0 272 KBytes
[ 5] 9.00-10.00 sec 113 MBytes 944 Mbits/sec 0 5.66 KBytes
-----------------------------------------------------------
[ 5] 0.00-10.00 sec 1.10 GBytes 943 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver
Klient 2 – PC
Wynik:
Connecting to host 192.168.2.1, port 5201
[ 5] local 192.168.2.3 port 45194 connected to 192.168.2.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 114 MBytes 958 Mbits/sec 0 297 KBytes
[ 5] 1.00-2.00 sec 111 MBytes 934 Mbits/sec 0 291 KBytes
[ 5] 2.00-3.00 sec 112 MBytes 941 Mbits/sec 0 272 KBytes
[ 5] 3.00-4.00 sec 113 MBytes 949 Mbits/sec 0 274 KBytes
[ 5] 4.00-5.00 sec 112 MBytes 938 Mbits/sec 0 288 KBytes
[ 5] 5.00-6.00 sec 112 MBytes 940 Mbits/sec 0 277 KBytes
[ 5] 6.00-7.00 sec 112 MBytes 943 Mbits/sec 0 283 KBytes
[ 5] 7.00-8.00 sec 112 MBytes 940 Mbits/sec 0 280 KBytes
[ 5] 8.00-9.00 sec 112 MBytes 940 Mbits/sec 0 274 KBytes
[ 5] 9.00-10.00 sec 113 MBytes 948 Mbits/sec 0 5.66 KBytes
-----------------------------------------------------------
[ 5] 0.00-10.00 sec 1.10 GBytes 944 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver
Wynik końcowy
Dwa równoległe połączenia:
~940 Mbps + ~940 Mbps
Łącznie ~1.9 Gbps