Port Forwarding - Allow only certain IP ranges.
-
I have a web server port forwarded to port 80 in pfsense, and I want to allow ONLY CloudFlare IP ranges to be able to access my web server at port 80. Is it possible to add multiple networks to the "Source" section when port forwarding? I need to whitelist the following IP addresses: https://www.cloudflare.com/ips/
The goal is that if a user tries to connect to my web server directly via port 80, they are blocked/cannot access the web server, but I wish to have Cloudflare to be able to access it.
Thanks
-
Create an alias, put those net blocks into the alias, use the alias as your source on your portforward.
You could prob get fancy and use the https://www.cloudflare.com/ips-v4 in some way. I believe the pfblocker package allows you to create aliases from urls.
-
Oh I see, thanks :)
-
You don't need pfBlocker for that.
IF you want to trust that URL as the source of a list of networks in a pfSense alias, just make a Firewall > Aliases, URL alias like this:

 -
Yeah my bad in not pointing out the built in way ;) I had pfblocker on my mind from some other thread.. hehehe
Derelict is pointing to the better way that is for, no offense to bcan but the pfblocker package has gotten a bit bloated ;)
I need to fire up pfblocker again though.. Do some playing with latest version.. one thing that curious is pfblocker can use HUGE sets for aliases… But the built in alias says to use small sets..
Use only with small sets of IP addresses (less than 3000).
the US listing from IPdeny has almost 50,000 rows of cidr blocks..
http://www.ipdeny.com/ipblocks/data/countries/us.zoneCan that be used with the built in aliases or will that cause a problem? pretty sure pblocker is another interface into the aliases.. So either he breaking suggestions from pfsense for the size of these aliases or the text should prob be updated to the actual value that can be used..
There is the table IPs url and this allows for 30K listings, but you can only use 1 url?