PfBlockerNG
-
Yes the recent changes in pfense 2.3 from Lighttpd to NGINX broke the DNSBL feature… I will be submitting a PR to fix this up soon....
Any news on this front I upgraded to 2.3 and I think this blew up. It came up without DNS working and I removed the DNSBL stuff to get a working config. Reading the forum now for status.
Cheers!
Hey Dan, if I recall, you are using a Nano or Ramdisk correct?
If that is the case, when you did your update, Unbound had the Adv. Options with the "server:include: /var/unbound/pfb_dnsbl.conf" line but since the /var folder is wiped out, Unbound crashes due to this missing file.
You can run a "Force Update" in pfBNG to get it working again.
For others with this issue (Nano/RamDisk). Best to disable the pfBNG package before an Update or a configuration Restore (IE: Make sure the backup configuration has pfBNG disabled)
-
I'm running the last 2.3 and getting a lot those errors:
Hi, Those errors don't point to the issue unfortunately… Could you take a look at the file /tmp/PHP_errors.log and see if it shows any other clues?
It looks like the pfBlockerNG Cron task is being called, but there is no specific error indicated? Also take a look at the pfblockerng.log file around the timestamps of these errors, and see if they report any additional clues…
-rw-r--r-- 1 root wheel 0 Apr 14 12:26 PHP_errors.log
===[ DNSBL Process ]================================================ Warning: Invalid argument supplied for foreach() in /usr/local/pkg/pfblockerng/pfblockerng.inc on line 3057 Call Stack: 0.0019 211244 1\. {main}() /usr/local/www/pfblockerng/pfblockerng.php:0 0.0902 6447240 2\. pfblockerng_sync_cron() /usr/local/www/pfblockerng/pfblockerng.php:94 0.0904 6450620 3\. sync_package_pfblockerng() /usr/local/www/pfblockerng/pfblockerng.php:387 Clearing all DNSBL Feeds... completed Validating database... completed Restarting Unbound ... completed DNSBL update [ 0 ]... completed ------------------------------------------
-
Part of coding apoint the error:
// Save alias statistics to file (Remove any feeds that are not referenced) $handle = @fopen("{$pfb['dnsbl_info']}", 'w'); fwrite($handle, "# Keeping this file open in a file editor will interrupt DNSBL!\n");
foreach ($dnsbl_info as $alias) {
if (in_array($alias[0], $alias_dnsbl_all)) { fputcsv($handle, $alias); } } @fclose($handle);
-
Warning: Invalid argument supplied for foreach() in /usr/local/pkg/pfblockerng/pfblockerng.inc on line 3057
Clearing all DNSBL Feeds… completed
Validating database... completed
Restarting Unbound ... completed
DNSBL update [ 0 ]… completedDoes DNSBL have any defined Feeds? Its showing as "0"? If you don't use DNSBL, then disable it, or add some Feeds…
However, to fix this issue, will need to add two lines of code as indicated in Red below. I didn't adjust the line spacing, to make it easier for you to add in these two lines... Will get this added to the next Pull Request...
// Save alias statistics to file (Remove any feeds that are not referenced)
$handle = @fopen("{$pfb['dnsbl_info']}", 'w');
fwrite($handle, "# Keeping this file open in a file editor will interrupt DNSBL!\n");
if (!empty($dnsbl_info)) {
foreach ($dnsbl_info as $alias) {
if (in_array($alias[0], $alias_dnsbl_all)) {
fputcsv($handle, $alias);
}
}
}
@fclose($handle); -
Fixed.
Thanks
-
What up, @BBcan177!
Long-time lurker, first-time poster. I think I've discovered a bug in your otherwise fantastic piece of software. I'm on the latest versions of everything and have DNSBL up and running smoothly. I have the North America list set to Alias Native for the United States only, and I have the pfb_NAmerica alias used in a WAN rule to allow access to an OpenVPN server running on pfSense from the public internet, but only from United States source IP's. I also have the option selected in pfBlockerNG to kill states during cron/force update. When I run a force update with the setup outlined above, after the block lists are updated, the log shows pfBlockerNG removing the states of what looks like all active connections to United States IP's with the culprit being [ pfB_NAmerica_v4-Inbound ]. This happens whether or not logging to the firewall log is enabled for the rule and whether or not the rule is set to disabled. Changing the list action to Alias Permit or Alias Match instead of Alias Native also doesn't change this behavior; states still get killed. Removing the alias from the rule or completely deleting the rule does end the update massacre.
If a list is set to Alias Native, shouldn't pfBlockerNG only kill the states for that list if the alias is used in an active (not disabled) blocking rule? Also, I wouldn't expect that a list set to Alias Permit or Alias Match would ever have its states killed. Am I missing something?
-
Hello,
For Outbound Interface I have 'LAN' selected and 'Deny Both' in the IPv4 lists. Is it possible exclude a source ip address from the LAN interface? I dont want to use 'Deny Outbound' for a particular ip address.
Thanks
-
Hello,
For Outbound Interface I have 'LAN' selected and 'Deny Both' in the IPv4 lists. Is it possible exclude a source ip address from the LAN interface? I dont want to use 'Deny Outbound' for a particular ip address.
Thanks
Try the Advanced Outbound Rule settings:
Create a pfSense Alias "ExcludedIP" and add any (lan) SRC IPs that you want to exclude… Check the "Invert" option. Also change the "Custom Protocol" setting to "TCP/UDP":
( The created Firewall Rule is shown in the Red box )NOTE - There is a bug with the existing package for "Outbound Protocol" settings. I have a fix for for this in the pfSense 2.3 version of pfBlockerNG in PR #107, that is waiting to be merged…
-
Thanks for the screenshot. But instead of source, i have a destination?
-
Yes that is also part of the fix in PR #107… Sometimes copy/paste is a bad thing... Its really "Custom Source"... Wait for the next version and it should work for you :)
-
Hey everyone,
My apologies, but I'm just not getting how to make the ipv4 lists work.
I have an i-blocklist subscription and I enter in the list and can see when I update that it's finding updates, but I don't see any alias created or any rules made outside of the country blocks. Should I see any firewall alias's or rules after entering an ipv4 list/s?
I've done my fair share of looking through this thread and I still can't figure it out. Any help would be greatly appreciated, even if its "no you're doing it wrong".
Thanks,
Tom
-
Hi Tom,
What does the text say just below the "Save" button :)
Goto the Update Tab and click "Force Update".
Also instead of blocking the world, best to permit the ones that you want. I've written about that in this thread and in Reddit.
-
I do the force update, but it doesn't seem to have an effect. Every time my tab (Chrome) will show the spinning icon, and eventually I will get an nginx timeout.
-
What does the pfblockerng.log show? Goto the Log Browser tab to view it for clues. Never seen this issue before.
What pfSense version? What kind of hardware? If your blocking the world, you might be blocking DNS servers (if using the resolver) and IBlock urls might be in other Countries.
-
Only log that will show is the pfblocker log, all other logs show failure to read.
I'm on 2.3 release and the hardware is a Dell Optiplex 960
https://www.dell.com/downloads/global/products/optix/en/desktop-optiplex-960-technical-guidebook-en.pdf.
-
Are there any more lines in the pfblockerng.log file? Can you scroll down to see the end of the log? Those entries are ~24hrs ago. Did you select the Interfaces in the General Tab?
-
Thats all there is in the log. Entries are recent, at least in my timezone :) Interfaces are configured per the screenshot below.
-
You clicked "Floating Rules". So any firewall rules will not show in the wan/lan tabs. Goto the floating tab to see the rules. If Cron is running. You will not be able to Force Update till cron completes. You should be able to hit "view" in the update Tab while Cron is running.
-
Here is what I have on the floating rules. Should there be additional rules for ipv4 lists?
-
Here is what I have on the floating rules. Should there be additional rules for ipv4 lists?
Hi samoth, I sent you a PM…
-
Hi,
I think I found the reason why DNSBL wasn't working for me when using together with squid and .PAC file.
DNSBL creates to NAT rules to redirect ports 80 and 443 to the internal server on IP 127.0.0.1. But when using squid I am using ports 3128 and 3129.
So I created a second NAT rule - made a copy of the existing DNSBL rules - but with the squid ports.
Further I let pfsense create an "associated firewall rule" to make sure that access is allowed and further I wanted to use it to enable logging on this rule.So after these additional configuration options it is working for me. I can see the 1x1 pixel gif when accessing http or https and I get the access logged in the pfBlockerng Alerts tab.
So in a short summary I would say these additional steps have to be done when you want to use DNSBL togther with squid (and PAC file).
-
Define in the proxy PAC file to NOT use (go DIRECT and no through the proxy) the proxy for the DNSBL VIP. Probably best is to NOT use proxy for any private subnets like 192.168./16, 172.16./12, 10./8
-
Add an additional NAT rule for your proxy ports 3128 and 3129 - or whatever ports you used in your squid config
-
Create an "associated firewall rule" based on the NAT rule(s) you created and make sure it is placed in the correct order in your firewall rules and is not hidden by any other rule.
@BBcan177
Any idea to put an option into your package which allows the user to enable "Squid Proxy Support". Then the user should put in their squid ports and then DNSBL will automatically create an additional NAT rule for these ports and will create an additional Floating/Firewall rule. Then perhaps giving a little hint that when using PAC file the user needs to configure it PAC file to bypass proxy and go direct.
Don't know if you need this when using tranparent proxy.This option should be disabled by default so it will not cause any problems for the majority of users who do not use squid proxy and DNSBL together.
–--- EDIT -----
It looks like the additional NAT rules are NOT needed.
BUT the additional Firewall Rule IS needed.
-
-
Hi everyone!
I'm looking for some help to solve a strange issue with pfBlockerNG and OpenVPN.
On pfSense I've both OpenVPN client and server. Everything worked fine until I installed pfBlockerNG. Then, every 2 times I restart pfSense, the service status shows that OpenVPN server is not working.The thing is: OpenVPN server actually works if I test it! I can connect as normal, it's just pfSense that thinks it's not working.
If I reboot pfSense, then everything turns back to normal, and the problem reappears if I reboot once again, and so on.On boot, OpenVPN log reports this error:
May 5 17:43:13 openvpn 30398 TCP/UDP: Socket bind failed on local address [AF_INET]192.168.1.100:1194: Address already in use
192.168.1.100 is the WAN address. If I try to restart the service, i get a TUN/TAP device busy error, since it's actually being used.
It doesn't help to disable pfBlockingNG, but if I uninstall it then the problem disappears.
Another thing that "solves" the problem is to remove all the firewall's rules on OpenVPN, but then I have to manually add them again after reboot and remove them before the next reboot.What am I doing wrong? What did I miss?
pfSense v2.3
pfBlockingNG v2.0.12 -
Hi everyone!
I'm looking for some help to solve a strange issue with pfBlockerNG and OpenVPN.
On boot, OpenVPN log reports this error:
May 5 17:43:13 openvpn 30398 TCP/UDP: Socket bind failed on local address [AF_INET]192.168.1.100:1194: Address already in use
The only way I can see pfBlockerNG interfering with OpenVPN, is if you configured the DNSBL Port to use 1194?
Can you describe your Interfaces? and are you using DNSBL?
-
I tried DNSBL, but now it's disabled. I haven't changed the DNSBL's port, btw.
This is the list of my interfaces:
WAN - eth0
LAN - eth1
WIFI - wlan0
CLIENTS - vlan1
SERVERS - vlan2
BRIDGE - between WIFI and CLIENTS
VPN - used by VPN client -
I tried DNSBL, but now it's disabled. I haven't changed the DNSBL's port, btw.
This is the list of my interfaces:
WAN - eth0
LAN - eth1
WIFI - wlan0
CLIENTS - vlan1
SERVERS - vlan2
BRIDGE - between WIFI and CLIENTS
VPN - used by VPN clientSo if DNSBL is disabled, there is nothing else in pfBlockerNG that touches the ports. Could it be that a firewall rule is blocking something?
-
I thought of it too, but I can't find any difference on the firewall rules from when I don't have pfBlockerNG installed and when I do.
Plus the fact that it happens once every two reboots leaves me very confused… -
I thought of it too, but I can't find any difference on the firewall rules from when I don't have pfBlockerNG installed and when I do.
Plus the fact that it happens once every two reboots leaves me very confused…I don't think its an issue with the pfBlockerNG package… Try to post in the OpenVPN forum thread.
May 5 17:43:13 openvpn 30398 TCP/UDP: Socket bind failed on local address [AF_INET]192.168.1.100:1194: Address already in use
-
I've got pfSense at home and I wanted to put the lvl1 bluetack list in pfBlockerNG but when I get to that entry, it takes a long time for it to load and can make new DNS queries time out (I'm guessing since it's making changes to Unbound?)
Everything else is working fine. Running on a AMD Athlon II X2 240 Processor with 3GB of RAM.
Do I just need to throw more RAM in there or is there something I can tweak to fix this behavior?
Thanks,
-Nick-
-
I've got pfSense at home and I wanted to put the lvl1 bluetack list in pfBlockerNG but when I get to that entry, it takes a long time for it to load and can make new DNS queries time out (I'm guessing since it's making changes to Unbound?)
Everything else is working fine. Running on a AMD Athlon II X2 240 Processor with 3GB of RAM.
Do I just need to throw more RAM in there or is there something I can tweak to fix this behavior
I guess that Level 1 Bluetack is a subscription list… Not sure how many IPs are in that list? But I assume that its an IP list and not a DNSBL list, so it should be added to the IPv4 Tab. It shouldn't timeout Unbound tho...
-
Hi all,
I’ve just tried to install pfBlockerNG on pfSense 2.3.1_1 and I got error message:pkg: https://pkg.pfsense.org/pfSense_v2_3_1_amd64-pfSense_v2_3_1/All/pfSense-pkg-pfBlockerNG-2.0.17.txz: Not Found Failed
After quick check I found that repository contains 2.0.14 but not 2.0.17.
-
Hi all,
I’ve just tried to install pfBlockerNG on pfSense 2.3.1_1 and I got error message:pkg: https://pkg.pfsense.org/pfSense_v2_3_1_amd64-pfSense_v2_3_1/All/pfSense-pkg-pfBlockerNG-2.0.17.txz: Not Found Failed
After quick check I found that repository contains 2.0.14 but not 2.0.17.
Should be fixed now… One of the Devs looked into it...
-
Hope someone can help I have outbound deny selected on the IPV4 list below
Alias Name Alias Description Action Frequency Logging
IBlock pfBlockerNG IBlock Deny_Outbound 04hours enabledPRI1 pfBlockerNG PRI1 Deny_Outbound 01hour enabled
PRI2 pfBlockerNG PRI2 Deny_Outbound 04hours enabled
PRI3 pfBlockerNG PRI3 Deny_Outbound 04hours enabled
SEC1 pfBlockerNG SEC1 Deny_Outbound 04hours enabled
TOR pfBlockerNG TOR Deny_Outbound 04hours enabled
MAIL pfBlockerNG MAIL Deny_Outbound 08hours enabled
Now I want to keep all the listed enabled but i keep getting some good sites blocked like dropbox.com.
Can someone advice how i can exclude these destination domains please. I have tried the advance rule outbound invert but when i do it locks me out of the firewall interface.
-
Can someone advice how i can exclude these destination domains please. I have tried the advance rule outbound invert but when i do it locks me out of the firewall interface.
If an IP is getting blocked, then you can either: 1) Suppress the IP from the Alerts Tab 2) Create a new pfBlockerNG alias (Whitelist), and add the IP to the customlist and set the format to "Permit Outbound". Ensure that the "Rule Order" places the Permit Rules, above the Block/Reject Rules.
If a domain is getting blocked by DNSBL, then you need to suppress it from the Alerts Tab.
-
Can someone advice how i can exclude these destination domains please. I have tried the advance rule outbound invert but when i do it locks me out of the firewall interface.
If an IP is getting blocked, then you can either: 1) Suppress the IP from the Alerts Tab 2) Create a new pfBlockerNG alias (Whitelist), and add the IP to the customlist and set the format to "Permit Outbound". Ensure that the "Rule Order" places the Permit Rules, above the Block/Reject Rules.
If a domain is getting blocked by DNSBL, then you need to suppress it from the Alerts Tab.
Thanks I will try that. :)
-
after i installed this package on a new installation, a error has pop up
Filter Reload
• There were error(s) loading the rules: /tmp/rules.debug:20: cannot define table bogonsv6: Cannot allocate memory - The line in question reads [20]: table <bogonsv6> persist file "/etc/bogonsv6" @ 2016-06-11 23:56:52
any suggestions what its might be ? -
after i installed this package on a new installation, a error has pop up
Filter Reload
• There were error(s) loading the rules: /tmp/rules.debug:20: cannot define table bogonsv6: Cannot allocate memory - The line in question reads [20]: table <bogonsv6> persist file "/etc/bogonsv6" @ 2016-06-11 23:56:52
any suggestions what its might be ?The bogons is handled by the pfSense code not pfBlockerNG. Maybe try to disable and re-enable Bogons to see what that does. The package changes the max table entry in the advanced settings automatically so it shouldn't be that.
-
after i installed this package on a new installation, a error has pop up
Filter Reload
• There were error(s) loading the rules: /tmp/rules.debug:20: cannot define table bogonsv6: Cannot allocate memory - The line in question reads [20]: table <bogonsv6> persist file "/etc/bogonsv6" @ 2016-06-11 23:56:52
any suggestions what its might be ?The bogons is handled by the pfSense code not pfBlockerNG. Maybe try to disable and re-enable Bogons to see what that does. The package changes the max table entry in the advanced settings automatically so it shouldn't be that.
will do it and report back,
can i filter the internet with this package ?
block adult websites ? porn ?
does the package wordt with squad guard and squid 3 ? -
Can someone advice how i can exclude these destination domains please. I have tried the advance rule outbound invert but when i do it locks me out of the firewall interface.
If an IP is getting blocked, then you can either: 1) Suppress the IP from the Alerts Tab 2) Create a new pfBlockerNG alias (Whitelist), and add the IP to the customlist and set the format to "Permit Outbound". Ensure that the "Rule Order" places the Permit Rules, above the Block/Reject Rules.
If a domain is getting blocked by DNSBL, then you need to suppress it from the Alerts Tab.
BBCan- first off, great work. Been using pfblocker for a bit and love it (one of my favorite packages on pfsense.) Second- trying to suppress an internal IP (ie. 192.168.1.xxx). I do not have ANY + sign in the alerts tab to add it to the suppression list. As far as I understand, you can add NATted local IPs to the list right? Even when I modify the alias directly and reload, pfblocker continues to block the packets.
For reference, I am blocking LAN outbound to certain countries and some on WAN too perhaps (not at the box to check.) But regardless, it just seems like my box is not working as it should. I'm running 2.3.1-p5 but I DID upgrade from 2.2.6 with pfblocker still installed (I stupidly didn't uninstall before the big upgrade.)
Any ideas?
-
Trying to suppress an internal IP (ie. 192.168.1.xxx).
I do not have ANY + sign in the alerts tab to add it to the suppression list. As far as I understand, you can add NATted local IPs to the list right? Even when I modify the alias directly and reload, pfblocker continues to block the packets.
You don't suppress Internal IPs.. Suppression is for External IPs and the Suppression Icon is only visible when "suppression" is enabled, and when the External IP is a /32 or /24. Also it won't suppress for Country Blocking…
To have some internal IPs excluded from the Block Rules… Best to use the "Adv. Inbound/Outbound" Rule settings.
-
Trying to suppress an internal IP (ie. 192.168.1.xxx).
I do not have ANY + sign in the alerts tab to add it to the suppression list. As far as I understand, you can add NATted local IPs to the list right? Even when I modify the alias directly and reload, pfblocker continues to block the packets.
You don't suppress Internal IPs.. Suppression is for External IPs and the Suppression Icon is only visible when "suppression" is enabled, and when the External IP is a /32 or /24. Also it won't suppress for Country Blocking…
To have some internal IPs excluded from the Block Rules… Best to use the "Adv. Inbound/Outbound" Rule settings.
Sounds good. Part of me thought that I'd have to adjust the rules and couldn't use the suppression but I figured I'd try.
Thanks again mate.