Skip to content

Refer to range of IPs and use of wildcards #113

@rockyhotas

Description

@rockyhotas

Hello!
I am not sure about the category of this issue (bug report, improvement suggestion, ...), so I chose to create a blank one.
Using npf in NetBSD 9.0 (release), I did not manage to refer to a range of IPs in the filter syntax. I tried:

block in family inet4 proto tcp from <source_host_IP> to <first_IP_of_range>-<last_IP_of_range>

but this generated a syntax error. My intention was to refer to a range like 192.168.1.10-192.168.1.20, which does not necessarily correspond to a subnet, and which therefore is completely custom.

I avoided the use of a table because I may need to refer to a huge number of IPs, for example 10.0.0.50-10.0.1.251, and writing each of them in a table seems quite inefficient.

Similarly, I tried to refer to any third-level domain in (e.g.) example.org:

block in family inet4 proto tcp from <source_host_IP> to *.example.org

but this provoked a syntax error, too.

Am I using the wrong syntax and some other wildcard characters are needed, or does npf not have these capabilities?

If it's the second case, is there a chance that they will be added in a future?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions