|
本帖最后由 kasda 于 2025-6-11 16:06 编辑
Hi, 请教一下,为什么我在小米mini上刷openwrt后,运行mwan3的结果不正常?数据没有按照指定的那一个WAN口传输。是不是mwan3功能不完善?
运行mwan3的路由器环境:
xiaomi mini router + openwrt 24 firmware, 包括mwan3, iptables-nft, ip6tables-nft.
网络拓扑:
computer(192.168.1.144, iperf3 client) -------- xiaomi mini router wan(LAN=192.168.1.1, wan=192.168.20.29) ------ router A(192.168.20.1) ------- iperf3 server(192.168.20.183)
computer(192.168.1.144, iperf3 client) -------- xiaomi mini router wanb(LAN=192.168.1.1, wanb=192.168.0.128) ------ router B(LAN=192.168.0.1, WAN=192.168.20.30) --------- router A(192.168.20.1) ------- iperf3 server(192.168.20.183)
xiaomi mini router:
wan: eth0.2
wanb: eth0.3
以下ping都正常:
ping baidu.com -I eth0.2
ping baidu.com -I eth0.3
mwan3规则:
root@OpenWrt:~# cat /etc/config/mwan3
...
config rule 'https'
option sticky '1'
option dest_port '443'
option proto 'tcp'
option use_policy 'balanced'
config rule 'udp_wan1'
option family 'ipv4'
option proto 'udp'
option src_ip '192.168.1.144'
option sticky '1'
option use_policy 'wan_only'
config rule 'tcp_wanb'
option family 'ipv4'
option proto 'tcp'
option src_ip '192.168.1.144'
option sticky '1'
option use_policy 'wanb_only' <-- 测试结果不是走wanb,而是走的wan。
config rule 'default_rule_v4'
option dest_ip '0.0.0.0/0'
option use_policy 'wanb_only'
option family 'ipv4'
option proto 'all'
option sticky '0'
config rule 'default_rule_v6'
option dest_ip '::/0'
option use_policy 'balanced'
option family 'ipv6'
路由表信息正常:
root@OpenWrt:~# ip route
default via 192.168.0.1 dev eth0.3 proto static src 192.168.0.128 metric 5
default via 192.168.20.1 dev eth0.2 proto static src 192.168.20.29 metric 10
192.168.0.0/24 dev eth0.3 proto static scope link metric 5
192.168.1.0/24 dev br-lan proto kernel scope link src 192.168.1.1
192.168.20.0/24 dev eth0.2 proto static scope link metric 10
root@OpenWrt:~#
1. 测试iperf3之前
root@OpenWrt:~# ifconfig
......
eth0.2 Link encap:Ethernet HWaddr 64:09:80:4B:96:5E
inet addr:192.168.20.29 Bcast:192.168.20.255 Mask:255.255.255.0
inet6 addr: fe80::6609:80ff:fe4b:965e/64 Scope ink
inet6 addr: 240e:3b6:32b0:9de0:6609:80ff:fe4b:965e/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:47027 errors:0 dropped:0 overruns:0 frame:0
TX packets:163377 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2702922 (2.5 MiB) TX bytes:245544160 (234.1 MiB)
eth0.3 Link encap:Ethernet HWaddr 64:09:80:4B:96:5E
inet addr:192.168.0.128 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::6609:80ff:fe4b:965e/64 Scope ink
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:725 errors:0 dropped:0 overruns:0 frame:0
TX packets:453 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:91207 (89.0 KiB) TX bytes:56342 (55.0 KiB)
2. UDP测试:数据走的wan/eth0.2
C:\Users\Administrator>D:\software+tools\iperf3.16_64\iperf3.exe -c 192.168.20.183 -u -b 100M
Connecting to host 192.168.20.183, port 5201
[ 5] local 192.168.1.144 port 65227 connected to 192.168.20.183 port 5201
[ ID] Interval Transfer Bitrate Total Datagrams
[ 5] 0.00-1.01 sec 11.4 MBytes 94.9 Mbits/sec 8195
[ 5] 1.01-2.01 sec 11.4 MBytes 95.7 Mbits/sec 8197
[ 5] 2.01-3.00 sec 11.3 MBytes 95.3 Mbits/sec 8111
[ 5] 3.00-4.01 sec 11.5 MBytes 95.7 Mbits/sec 8255
[ 5] 4.01-5.01 sec 11.5 MBytes 95.7 Mbits/sec 8229
[ 5] 5.01-6.00 sec 11.3 MBytes 95.7 Mbits/sec 8105
[ 5] 6.00-7.00 sec 11.4 MBytes 95.7 Mbits/sec 8182
[ 5] 7.00-8.00 sec 11.4 MBytes 95.7 Mbits/sec 8207
[ 5] 8.00-9.00 sec 11.4 MBytes 95.7 Mbits/sec 8158
[ 5] 9.00-10.01 sec 11.5 MBytes 95.7 Mbits/sec 8251
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-10.01 sec 114 MBytes 95.6 Mbits/sec 0.000 ms 0/81890 (0%) sender
[ 5] 0.00-10.01 sec 114 MBytes 95.5 Mbits/sec 0.011 ms 0/81818 (0%) receiver
iperf Done.
root@OpenWrt:~# ifconfig
......
eth0.2 Link encap:Ethernet HWaddr 64:09:80:4B:96:5E
inet addr:192.168.20.29 Bcast:192.168.20.255 Mask:255.255.255.0
inet6 addr: fe80::6609:80ff:fe4b:965e/64 Scope ink
inet6 addr: 240e:3b6:32b0:9de0:6609:80ff:fe4b:965e/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:49370 errors:0 dropped:0 overruns:0 frame:0
TX packets:245341 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3057293 (2.9 MiB) TX bytes:368549293 (351.4 MiB)
eth0.3 Link encap:Ethernet HWaddr 64:09:80:4B:96:5E
inet addr:192.168.0.128 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::6609:80ff:fe4b:965e/64 Scope ink
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:876 errors:0 dropped:0 overruns:0 frame:0
TX packets:541 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:114863 (112.1 KiB) TX bytes:64699 (63.1 KiB)
3. TCP测试:数据走的wan/eth0.2
C:\Users\Administrator>D:\software+tools\iperf3.16_64\iperf3.exe -c 192.168.20.183
Connecting to host 192.168.20.183, port 5201
[ 5] local 192.168.1.144 port 63303 connected to 192.168.20.183 port 5201
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.01 sec 11.8 MBytes 98.0 Mbits/sec
[ 5] 1.01-2.01 sec 11.4 MBytes 95.0 Mbits/sec
[ 5] 2.01-3.00 sec 11.1 MBytes 93.9 Mbits/sec
[ 5] 3.00-4.02 sec 10.8 MBytes 89.1 Mbits/sec
[ 5] 4.02-5.00 sec 10.5 MBytes 89.2 Mbits/sec
[ 5] 5.00-6.01 sec 10.8 MBytes 89.2 Mbits/sec
[ 5] 6.01-7.01 sec 10.4 MBytes 87.4 Mbits/sec
[ 5] 7.01-8.00 sec 11.2 MBytes 94.8 Mbits/sec
[ 5] 8.00-9.01 sec 11.4 MBytes 94.9 Mbits/sec
[ 5] 9.01-10.00 sec 11.2 MBytes 94.8 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.00 sec 110 MBytes 92.6 Mbits/sec sender
[ 5] 0.00-10.00 sec 110 MBytes 92.5 Mbits/sec receiver
iperf Done.
root@OpenWrt:~# ifconfig
......
eth0.2 Link encap:Ethernet HWaddr 64:09:80:4B:96:5E
inet addr:192.168.20.29 Bcast:192.168.20.255 Mask:255.255.255.0
inet6 addr: fe80::6609:80ff:fe4b:965e/64 Scope ink
inet6 addr: 240e:3b6:32b0:9de0:6609:80ff:fe4b:965e/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:91266 errors:0 dropped:0 overruns:0 frame:0
TX packets:324809 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5135430 (4.8 MiB) TX bytes:488716730 (466.0 MiB)
eth0.3 Link encap:Ethernet HWaddr 64:09:80:4B:96:5E
inet addr:192.168.0.128 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::6609:80ff:fe4b:965e/64 Scope ink
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:942 errors:0 dropped:0 overruns:0 frame:0
TX packets:598 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:120513 (117.6 KiB) TX bytes:72670 (70.9 KiB)
请大家指教,谢谢!
|
|