adoal
2021-06-07 21:39:59 +08:00
set firewall group address-group DYN_XXW
set firewall group network-group STATIC_XXW network xx.xxx.xx.0/24
...
set firewall group network-group STATIC_XXW network xx.xxx.xx.0/20
set firewall modify AUTO_VPN rule 20 action modify
set firewall modify AUTO_VPN rule 20 description 'XXWList address resolved by dnsmasq-ipset'
set firewall modify AUTO_VPN rule 20 destination group address-group DYN_XXW
set firewall modify AUTO_VPN rule 20 modify table 8
set firewall modify AUTO_VPN rule 20 protocol all
set firewall modify AUTO_VPN rule 21 action modify
set firewall modify AUTO_VPN rule 21 description 'Static XXW networks'
set firewall modify AUTO_VPN rule 21 destination group network-group STATIC_XXW
set firewall modify AUTO_VPN rule 21 modify table 8
set firewall modify AUTO_VPN rule 21 protocol all
set protocols static table 8 route 0.0.0.0/0 next-hop yy.yy.yy.yy
set service dns forwarding options 'conf-dir=/config/data/dnsmasq.d,*.conf'
其中 STATIC_GFW 里加的地址可以是类似电报这种不通过域名解析的 AS 静态网段,当然也可以把股沟等确定范围的网段加进去而不必要通过 dnsmasq+ipset 来处理。
DYN_XXW 是通过 dnsmasq+ipset 来处理的目标地址。
table 8 的 next-hop 是你内网里另外的小盒子,上面开一个小众协议的 VPN……(抱歉我不会玩 SS 所以举不出 SS 做透明 proxy 的配置例子,我是用的其它的小众协议)。
/config/data/dnsmasq.d 里放 dnsmasq 的附加配置文件,比如 xxwlist2dnamasq 生成的.conf 文件。