sing-box icon indicating copy to clipboard operation
sing-box copied to clipboard

Support matching ip interface id for ip_cidr rule

Open blip opened this issue 1 year ago • 5 comments

Added support for matching IPv6's interface id, using a syntax like ::1/::ff in ip_cidr and source_ip_cidr.

Fix #2204

cc @dyhkwong

blip avatar Oct 21 '24 23:10 blip

I don't merge PR but here is my thoughts:

  • This is only a syntactic sugar of existing functionality.

  • CIDR is also used elsewhere, e.g. tun.address, tun.route_address and tun.route_exclude_address.

  • This may require a version bump of ruleset. There is already a pending one https://github.com/SagerNet/sing-geosite/commit/9f8a5e7cba4f10cbb65ea2ba2ce81201bdb0595a.

dyhkwong avatar Oct 22 '24 05:10 dyhkwong

Not sure i quite understand

This is only a syntactic sugar of existing functionality.

Maybe I missed something, but how can an interface id currently be matched without this PR?

CIDR is also used elsewhere, e.g. tun.address, tun.route_address and tun.route_exclude_address.

These are not matching rules? Are you suggesting they should also support the ::1/:ff syntax? But this syntax is not a valid address.

blip avatar Oct 22 '24 06:10 blip

Maybe I missed something, but how can an interface id currently be matched without this PR?

So this is in fact something like SagerNet/sing-box#2014?

dyhkwong avatar Oct 22 '24 08:10 dyhkwong

yep, that person was asking the same feature. But it's not really syntactic sugar if it's not already achievable with the current rules, imho.

blip avatar Oct 22 '24 08:10 blip

Maybe this should be a new type of rule. And the author of #2014 mentioned that this is also for tun.route_address_set?

dyhkwong avatar Oct 22 '24 09:10 dyhkwong