This topic created in 650 days ago, the information mentioned may be changed or developed.
GL-MT6000 安装 ImmortalWrt 23.05.3 ,wan1/2/3 使用 mwan3 根据目标 IP 进行分流,运行一段时间后无法通过 wan3 IP 入站(如 RDP 入站,此时能通过 wan3 出站,但 wan3 网速、延迟都明显变差)( wan2 无公网 IPv4 无法测试)。
怀疑 mwan3 与 fw3(iptables)/fw4(nftables) 混用存在问题,尽管已经装了 iptables-nft ip6tables-nft
x86 + ImmortalWrt 23.05.3 也存在同样问题,x86 + ImmortalWrt 21.02.7 (防火墙为纯 iptables )则能保持稳定正常使用。
得知 pbr 可原生支持 nftables ,于是想从 mwan3 转到 pbr ,现在 pbr 出站策略还比较好配置,但非默认网关 wan 入站不知如何配置,比如默认网关是 wan1 ,想通过 wan3 IP 连接本地服务(源进源出),请问应如何配置?求指导,谢谢~
9 replies • 2024-08-09 16:17:32 +08:00
 |
|
1
titanium98118 Aug 9, 2024 1
r5c ImmortalWrt 23.05.0-rc1 mwan3 ,距上次重启 50 天 没遇到你的问题,wan1 wan2 进站正常
|
 |
|
2
microka Aug 9, 2024
@ titanium98118 我 wan1 wan3 是同个光猫出来的,wan1 用 ImmortalWrt 拨号,wan3 试过用 ImmortalWrt 或者光猫拨号,都有这问题,x86 换回 ImmortalWrt 21.02.7 就没问题。折腾得心好累😂
|
 |
|
4
htfcuddles Aug 9, 2024
ImmortalWrt 23.05.0-rc3 mwan3 wtih fw4 运行挺久了,没遇到你说的问题,把 debug 信息贴出来看看
|
 |
|
5
htfcuddles Aug 9, 2024 1
另外,入站一般不需要配置的,mwan3 的默认规则里有针对来源接口的路由,建议你看看 wiki:
1. Restore mark if previous set. If successful marked, goto step 5. 2. Check if the packet arrives on a wan interface. If originated from a local connected ip network, then mark packet with default iface_id. If the packet is from another (non-local) network and arrives on wan interface, then mark it with iface_id. If successful marked, goto step 5. 3. Check if packet destined for a known ip network (has a route for it other than default). If so then mark packet with default iface_id and goto step 5. 4. Check if packet source address is that of a wan interface. If so use that wan interface for routing regardless of user defined rules and mark packet with iface_id of corresponding wan. 5. Apply user rules and mark with configured iface_id. If no match leave unmarked. 6. If marked then save mark.
|
 |
|
6
htfcuddles Aug 9, 2024 1
第 3 第 4 条就是入站来源的路由:
Output of "ip -4 rule show" ------------------------------------------------- 0: from all lookup local 1000: from all fwmark 0x162 lookup 354 1001: from all iif pppoe-wan1 lookup 1 1002: from all iif pppoe-wan2 lookup 2 2001: from all fwmark 0x100/0x3f00 lookup 1 2002: from all fwmark 0x200/0x3f00 lookup 2 2061: from all fwmark 0x3d00/0x3f00 blackhole 2062: from all fwmark 0x3e00/0x3f00 unreachable 3001: from all fwmark 0x100/0x3f00 unreachable 3002: from all fwmark 0x200/0x3f00 unreachable 32766: from all lookup main 32767: from all lookup default
|
 |
|
7
htfcuddles Aug 9, 2024 1
mwan3 是用 policy routing 基于 fwmark 分流的,mangle 表里有相应规则。一个常见的问题是如果有其他插件设置了 fwmark ,需要改默认的 fwmask (#6 的 0x3f00 ),如果这个插件不支持 fwmask 那就是不兼容。openclash 就有这个问题,fw4 的处理有问题,需要魔改一下脚本
|
 |
|
9
onetown Aug 9, 2024 1
源进源出很简单的, 就是为某个 wan 设置一个单独的路由表, 例如我电信的地址是 2.2.2.2 , 网关 2.2.2.1 , 我们需要 路由表: ip r a default via 2.2.2.1 table 2
pbr: ip rule add to 2.2.2.2 lookup 2
这样你就可以随便从哪里访问 2.2.2.2 了
|