OPNsense Forum

Archive => 20.1 Legacy Series => Topic started by: Pfirepfox on April 07, 2020, 02:53:19 PM

Title: Wildcard hosts in Firewall alias
Post by: Pfirepfox on April 07, 2020, 02:53:19 PM
Hi All,

It seems as if the alias "Hosts" lists under the Firewall do not accept wildcard entries. I have tried using "*.domain.com" and ".domain.com" but neither appear to work and i cant find any documentation on this.

What is the syntax to allow wildcards in Firewall Aliases?
Title: Re: Wildcard hosts in Firewall alias
Post by: nothing on April 07, 2020, 06:59:59 PM
I don't think that's possible at all :)

Imagine how the firewall works - when you enter fqdn, the engine resolves it to IP (or IPs) and create the rules. There might be configured refresh time to update the resolving table. So how would you imagine resolving *.domain.tld? :)

Depending on the desired results, you should consider different approach.
Title: Re: Wildcard hosts in Firewall alias
Post by: Pfirepfox on April 08, 2020, 02:31:50 AM
Multiple Firewall vendors have the ability to do this, so i am not too sure if it is an engine limitation or just hasn't been developed yet for OPNSense.

I need to add 500+ hosts as an alias list which are all near identical , EG: syd01.media.com, syd02.media.com etc...

What is the best way to achieve this other than copying and pasting it 500+ times?
Title: Re: Wildcard hosts in Firewall alias
Post by: hbc on April 09, 2020, 11:12:01 PM
If these are webpages, you can block via proxy and regex.

syd[0-9][0-9]\.media\.com