IP-Blocklist
-
Hi there,
Quick question, I tried to install IP-Blocklist on my 1.2.3 Embedded system.
The installation is ok (tooks few seconds on : Executing custom_php_install_command()…) and then I'v got this message in the config pageWarning: fopen(lists.txt): failed to open stream: Read-only file system in /usr/local/www/packages/ipblocklist/ipblocklist_list.php on line 69 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/www/packages/ipblocklist/ipblocklist_list.php on line 70 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/www/packages/ipblocklist/ipblocklist_list.php on line 75 Warning: filesize(): Stat failed for lists.txt (errno=2 - No such file or directory) in /usr/local/www/packages/ipblocklist/ipblocklist_list.php on line 79
When I try to add a list, it displays this
Warning: fopen(lists.txt): failed to open stream: Read-only file system in /usr/local/www/packages/ipblocklist/ipblocklist_list.php on line 69 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/www/packages/ipblocklist/ipblocklist_list.php on line 70 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/www/packages/ipblocklist/ipblocklist_list.php on line 72 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/www/packages/ipblocklist/ipblocklist_list.php on line 75 Warning: filesize(): Stat failed for lists.txt (errno=2 - No such file or directory) in /usr/local/www/packages/ipblocklist/ipblocklist_list.php on line 79
I tried to uninstall/reinstall but same error.
I tried with and without the *Enable IP-Blocklist" box checked
I tried with and without country-blockCheers
Darx
It's because you're running embedded. I don't have the time right now to work on embedded (sorry). If you know PHP I can take your fixes and update my package.
-
All he would have to do is use /tmp instead right? Since the list is pretty much volatile anyways. Not sure where the static parts would go in an embedded system though. Maybe I can throw together an embedded vm and work on it.
-
Hi there,
Quick question, I tried to install IP-Blocklist on my 1.2.3 Embedded system.
Which embedded image are you using?
-
It's because you're running embedded. I don't have the time right now to work on embedded (sorry). If you know PHP I can take your fixes and update my package.
Okay no problem. I can have a look to modify it.
I was thinking about to run the mount_rw script somewhere and then load the list.
I'll let you know if I found the solution without crashing my system :) -
-
-
Well, if I add a : conf_mount_rw(); in the script before the list creation, it should works isn't it ?
-
I tried ip-blocklist and could never get it to work. It shows that it's running but is always showing that is is blocking 0 Networks/IPs. Currrntly I'm using the CN and IN pg2.txt lists. I tried uninstalling/rebooting and reinstalling and the behavior didn't change. There isn't anything in the system log either:
Feb 2 08:28:16 check_reload_status: syncing firewall
Feb 2 08:27:05 check_reload_status: syncing firewall
Feb 2 08:26:36 syslogd: kernel boot file is /boot/kernel/kernel
Feb 2 08:26:36 syslogd: exiting on signal 15
Feb 2 08:26:25 syslogd: kernel boot file is /boot/kernel/kernel -
okay,
I edited the file ipblocklist_list.php
- added : require_once('config.inc');
- added : conf_mount_rw(); and conf_mount_ro(); around the block line 69.
I can now start and add lists in the ip-blocklist settings but it still displays
Current Status = Running
You are blocking 0 Networks/IPsAny idea ?
EDIT : When I try to delete a list, it reloads the config page in the iframe in the page ???
-
okay,
I edited the file ipblocklist_list.php
- added : require_once('config.inc');
- added : conf_mount_rw(); and conf_mount_ro(); around the block line 69.
I can now start and add lists in the ip-blocklist settings but it still displays
Current Status = Running
You are blocking 0 Networks/IPsAny idea ?
EDIT : When I try to delete a list, it reloads the config page in the iframe in the page ???
Are you using Firefox or Chrome?
-
I got Blocking 0 Networks/IP because it was not actually retrieving the lists and putting into the tables at all. Check pfctl -sa | more and see if the table even exists. If not I would check if it is referencing the path properly.
-
@nipstech:
I tried ip-blocklist and could never get it to work. It shows that it's running but is always showing that is is blocking 0 Networks/IPs. Currrntly I'm using the CN and IN pg2.txt lists. I tried uninstalling/rebooting and reinstalling and the behavior didn't change. There isn't anything in the system log either:
Feb 2 08:28:16 check_reload_status: syncing firewall
Feb 2 08:27:05 check_reload_status: syncing firewall
Feb 2 08:26:36 syslogd: kernel boot file is /boot/kernel/kernel
Feb 2 08:26:36 syslogd: exiting on signal 15
Feb 2 08:26:25 syslogd: kernel boot file is /boot/kernel/kernelI updated to the latest 2.0 snapshot and was able to get this from the system log:
Feb 2 19:27:58 check_reload_status: syncing firewall
Feb 2 19:27:58 php: /packages/ipblocklist/ipblocklist.php: The command 'rm errorOUT.txt' returned exit code '1', the output was 'rm: errorOUT.txt: No such file or directory'
Feb 2 19:27:58 php: /packages/ipblocklist/ipblocklist.php: The command 'rm -R /usr/local/www/packages/ipblocklist/lists' returned exit code '1', the output was 'rm: /usr/local/www/packages/ipblocklist/lists: No such file or directory'
Feb 2 19:27:58 php: /packages/ipblocklist/ipblocklist.php: The command 'ipfw -f flush' returned exit code '69', the output was 'ipfw: setsockopt(IP_FW_FLUSH): Protocol not available' -
@nipstech:
@nipstech:
I tried ip-blocklist and could never get it to work. It shows that it's running but is always showing that is is blocking 0 Networks/IPs. Currrntly I'm using the CN and IN pg2.txt lists. I tried uninstalling/rebooting and reinstalling and the behavior didn't change. There isn't anything in the system log either:
Feb 2 08:28:16 check_reload_status: syncing firewall
Feb 2 08:27:05 check_reload_status: syncing firewall
Feb 2 08:26:36 syslogd: kernel boot file is /boot/kernel/kernel
Feb 2 08:26:36 syslogd: exiting on signal 15
Feb 2 08:26:25 syslogd: kernel boot file is /boot/kernel/kernelI updated to the latest 2.0 snapshot and was able to get this from the system log:
Feb 2 19:27:58 check_reload_status: syncing firewall
Feb 2 19:27:58 php: /packages/ipblocklist/ipblocklist.php: The command 'rm errorOUT.txt' returned exit code '1', the output was 'rm: errorOUT.txt: No such file or directory'
Feb 2 19:27:58 php: /packages/ipblocklist/ipblocklist.php: The command 'rm -R /usr/local/www/packages/ipblocklist/lists' returned exit code '1', the output was 'rm: /usr/local/www/packages/ipblocklist/lists: No such file or directory'
Feb 2 19:27:58 php: /packages/ipblocklist/ipblocklist.php: The command 'ipfw -f flush' returned exit code '69', the output was 'ipfw: setsockopt(IP_FW_FLUSH): Protocol not available'That looks like logs left from re-moving the package. Did you uninstall to try and troubleshoot. I don't use ipfw anymore, I must have left that in the uninstall script. You can safely ignore those errors since ipblocklist uses pcftl for blocking IP ranges.
Here's what you can do to narrow down the problem. SSH into your box and navigate to /usr/local/www/packages/ipblocklist/ and run convert-execute.sh.
Make sure your list is working by pasting in the browser. I just checked the level1 example in the package and it seems like the host is now gone. Try http://iblocklist.rlcassidy.net/files/bt_level1.gz as a lvl1 list and see if this works. -
Are you using Firefox or Chrome?
Tested with chrome and firefox.
Also I tried to mount the CF card in RW mode via ssh. I don't have any warning, I can load lists but still have 0 ip blocked -
Are you using Firefox or Chrome?
Tested with chrome and firefox.
Also I tried to mount the CF card in RW mode via ssh. I don't have any warning, I can load lists but still have 0 ip blockedSSH into your box and navigate to /usr/local/www/packages/ipblocklist/ and run convert-execute.sh
Post any errors. -
Are you using Firefox or Chrome?
Tested with chrome and firefox.
Also I tried to mount the CF card in RW mode via ssh. I don't have any warning, I can load lists but still have 0 ip blockedSSH into your box and navigate to /usr/local/www/packages/ipblocklist/ and run convert-execute.sh
Post any errors.Here is :
0 table deleted.
0 table deleted.
./convert-execute.sh: /usr/bin/perl: not found
./convert-execute.sh: /usr/bin/perl: not found
rm: /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP: No such file or directory
rm: Wlists/whitelistTEMP: No such file or directory
rm: /tmp/rules.debug.tmp: No such file or directory
rm: /tmp/rules.debug.tmp: No such file or directory
0
1
2
..
..
219
220it displays numbers from 0 to 220
-
okay, found the solution
I edited the file ipblocklist_list.php
- added : require_once('config.inc');
- added : conf_mount_rw(); and conf_mount_ro(); around the block line 69
edited the file convert-execute.sh
- changed "usr/bin/perl" to "/usr/local/bin/perl"
edited convert.pl
- changed "usr/bin/perl" to "/usr/local/bin/perl"
It's now running and blocking the addresses I added in my list
EDIT : how can I verify if it's really working ?
EDIT 2 : I did not edit the whitelist.php file as I'm not using it… -
okay, found the solution
I edited the file ipblocklist_list.php
- added : require_once('config.inc');
- added : conf_mount_rw(); and conf_mount_ro(); around the block line 69
edited the file convert-execute.sh
- changed "usr/bin/perl" to "/usr/local/bin/perl"
edited convert.pl
- changed "usr/bin/perl" to "/usr/local/bin/perl"
It's now running and blocking the addresses I added in my list
EDIT : how can I verify if it's really working ?
EDIT 2 : I did not edit the whitelist.php file as I'm not using it…To verify you can look at the pfctl table. Just look at the php code that counts how many IP networks are being counted.
I'm glad you got it working! Since your running embedded I will just link to this post for other embedded users to view. Nice work! -
cool, all looks okay.
And btw, thanks for your package ;D
And for ppl with the embedded version, here is the detailed operation:
via SSH :
Login your system and go in the ip-blocklist folder : /usr/local/www/packages/ipblocklist
mount your CF card in RW mode with this command : /etc/rc.conf_mount_rw
edit the file ipblocklist_list.php- add this in the 3rd line of the file (the blank one…) : require_once('config.inc');
- line 66 add this line: conf_mount_rw();, it's just before this : $myFile = "lists.txt";
- line 75 add this line: conf_mount_ro();, it's just after this : fclose($fh);
save your file
check where is perl on your system with this command : find / -type f -name perl
if the result is not : /usr/bin/perl
edit files :- convert-execute.php
- convert.pl
and replace all the "/usr/bin/perl" instances with the path returned by the "find" command
then put your system back in RO mode with : /etc/rc.conf_mount_ro
If you don't like SSH, you can do everything from the admin page, using the Edit File function located in the Diagnostic menu. From there, you don't need to mount your system in RW mode, the admin page will do it for you
*/!\ this fix worked on my system but I'm not responsible if your crash yours… so be careful ;) /!*
-
Haven't used this package in a while.. Giving it a shot on my 2.0Beta5 build. When i disable IP-Blocklist, I see this error in my log:
Feb 4 16:21:54 php: /packages/ipblocklist/ipblocklist.php: The command 'ipfw -f flush' returned exit code '69', the output was 'ipfw: setsockopt(IP_FW_FLUSH): Protocol not available'
BTW great work!! this package is coming out real nice!