转载注明来源: 本文链接 来自osnosn的博客,写于 2025-11-20.
default via 10.100.9.1tracert -d -w 1 202.12.12.12测试,数据走的是wan1traceroute -n -w 1 202.12.12.12测试,数据走的是wan1ip route add 10.100.0.0/16 via 10.100.9.1 table 100 metric 10 ## 10.100网段还是走wan1
ip route add 0.0.0.0/0 via 192.168.8.1 table 100 metric 50 ## 其他数据走wan2
对应的luci操作,Network -> Routing -> Static IPv4 Routes -> 添加路由
---- 1 ----
- General Settings
- Interface: wan1
- Route type: unicast #默认值
- Target: 10.100.0.0/16
- Gateway: 10.100.9.1
- Advanced Settings
- Metric: 10
- Table: 100
- 其他内容: 默认/留空/不改变
---- 2 ----
- General Settings
- Interface: wan2
- Route type: unicast #默认值
- Target: 0.0.0.0/0
- Gateway: 192.168.8.1
- Advanced Settings
- Metric: 50
- Table: 100
- 其他内容: 默认/留空/不改变
ip rule add from all fwmark 100 lookup 100 pref 3000Network -> Routing -> IPv4 Rules -> 添加规则
- General Settings
- Priority: 3000
- Route type: unicast #默认值
- Table: 100
- Advanced Settings
- Firewall mark: 100
- 其他内容: 默认/留空/不改变
tracert -d -w 1 202.12.12.12测试,数据走的是wan1traceroute -n -w 1 202.12.12.12测试,数据走的是wan1nft add rule inet fw4 mangle_output ip daddr 202.12.12.12 counter meta mark set 0x64
对应的luci操作,Network -> Firewall -> Traffic Rules -> 添加规则
- General Settings
- protocol: Any
- Source Zone: Device (output)
- Output Zone: Any zone
- Destination address: 202.12.12.12
- Action: XOR firewall mark
- XOR mark: 100
- Advanced Settings
- Restrict to address family: IPv4 only
- 其他内容: 默认/留空/不改变
tracert -d -w 1 202.12.12.12测试,数据走的是wan1traceroute -n -w 1 202.12.12.12测试,数据走的是wan2nft add rule inet fw4 mangle_prerouting iifname "br-lan" ip daddr 202.12.12.12 counter meta mark set 0x64
对应的luci操作,Network -> Firewall -> Traffic Rules -> 添加规则
- General Settings
- protocol: Any
- Source Zone: LAN
- Destination Zone: Any zone
- Destination address: 202.12.12.12
- Action: XOR firewall mark
- XOR mark: 100
- Advanced Settings
- Restrict to address family: IPv4 only
- 其他内容: 默认/留空/不改变
win中使用 tracert -d -w 1 202.12.12.12测试,数据走的是wan2nft add rule inet fw4 mangle_output meta nfproto ipv4 udp dport { 34567, 34568 } counter meta mark set 0x64
对应的luci操作,Network -> Firewall -> Traffic Rules -> 添加规则
- General Settings
- protocol: UDP
- Source Zone: Device (output)
- Output Zone: Any zone
- Destination port: 34567 34568 #空格隔开的两个端口号
- Action: XOR firewall mark
- XOR mark: 100
- Advanced Settings
- Restrict to address family: IPv4 only
- 其他内容: 默认/留空/不改变
--end----
转载注明来源: 本文链接 https://www.cnblogs.com/osnosn/p/19309459.html
来自 osnosn的博客 https://www.cnblogs.com/osnosn/ .
登录查看全部
参与评论
手机查看
返回顶部