vernesong / OpenClash

A Clash Client For OpenWrt
MIT License
17.71k stars 3.2k forks source link

feat: support port range in common_ports #4130

Closed EkkoG closed 1 month ago

EkkoG commented 1 month ago

当前如果想添加端口范围会报错

root@ImmortalWrt:~# nft add element inet fw4 common_ports { "0-3477" } Error: You must add 'flags interval' to your set declaration if you want to add range elements add element inet fw4 common_ports { 0-3477 } ^^^^^^

添加 flags interval; 以后即可正常添加端口范围,且兼容原来的配置方法

设置常用端口 0-3477, 3479-65534, 65535 后的结果

    set common_ports {
            type inet_service
            flags interval
            elements = { 0-3477, 3479-65534, 65535 }
    }