HELLO_wORLD
Very Senior Member
DEPRECATED
Now use aegis:
https://www.snbforums.com/threads/aegis-a-firewall-blocklist.64128/
I made a blocklist based firewall addon for myself, and I improved it to share it here as it can interest others.
Firewall Blocklist
Firewall blocklist script for Netgear R7800 and R9000 Routers with Voxel firmware.
Should work with some other models as well.
What is it?
It is a script that allows to block a list of IP adresses or ranges for inbound and outbound traffic.
The main purpose is blocking dangerous adresses known for spam, hacking, malware, etc...
The blocklist is automatically generated from known sources (this is editable) and you can add your own IP adresses/ranges as well.
Instructions
Due to limited space per post, and having to write everything twice (different format), I invite now to read them here:
https://github.com/bolemo/firewall-blocklist/blob/master/README.md
Change log
v3.3.2
Now use aegis:
https://www.snbforums.com/threads/aegis-a-firewall-blocklist.64128/
I made a blocklist based firewall addon for myself, and I improved it to share it here as it can interest others.
Firewall Blocklist
Firewall blocklist script for Netgear R7800 and R9000 Routers with Voxel firmware.
Should work with some other models as well.
What is it?
It is a script that allows to block a list of IP adresses or ranges for inbound and outbound traffic.
The main purpose is blocking dangerous adresses known for spam, hacking, malware, etc...
The blocklist is automatically generated from known sources (this is editable) and you can add your own IP adresses/ranges as well.
Instructions
Due to limited space per post, and having to write everything twice (different format), I invite now to read them here:
https://github.com/bolemo/firewall-blocklist/blob/master/README.md
Change log
v3.3.2
- Fixed a bug with installer for new installs
- Minor bug fixes and optimizations
- Can be installed either on USB or internal memory (for people without USB drive)
- Protection will stay active after a router reboot if it was set and running before reboot
- If installed on USB, it will continue to work after a firmware update or reflash.
- The internal firewall will only be restarted if needed, so during an update, there should be no interruption in the blocklist protection, even for a second.
- blocklist can have more than 65536 elements (max elements will match number of netset entries)
- Minor bugfix
- Now install script offers to install iprange on R9000 models and to remove install files (one less install step).
- Upgrade fixed on routers without Entware (upgrade to 3.2.2 will still not work, but from 3.2.2 will work)
- Optimizations, code cleaning...
- Status should now be accurate on R9000.
- More details in verbose status.
- More optimizations and bugfixes.
- Custom black list of IPs file is now named /opt/bolemo/etc/firewall-blocklist.custom-bl.netset (the file does not exist by default, and is not mandatory: only if you have custom ip sets to add).
- Now, support custom white list. Works the same as the custom black list, and the file is /opt/bolemo/etc/firewall-blocklist.custom-wl.netset
- More bugfixes and optimizations (like when having 0.0.0.0/0 wan gateway)
- The generated netset file is now named /opt/bolemo/etc/firewall-blocklist-bl.netset so after upgrading, you can delete the old one: rm /opt/bolemo/etc/firewall-blocklist.netset
- It is recommended to clean before upgrading, so upgrade procedure is
Code:
/opt/bolemo/scripts/firewall-blocklist clean
/opt/bolemo/scripts/firewall-blocklist upgrade
/opt/bolemo/scripts/firewall-blocklist update
- It is also to be noted that our great @Voxel updated his Entware Repo and now iprange is also available this way as well (so can easily be installed on the router as an ipk or on USB Entware with /opt/bin/opkg install iprange). Thank you again @Voxel !
- Minor bugfixes and optimizations
- Now uses iprange when installed (install script allows to install it; can also be installed separately, see instructions https://github.com/bolemo/firewall-blocklist/blob/master/README.md#iprange )
- Now white lists the wan gateway only if it is in the block list
- Command parameters have been changed a little (and new ones)
- New commands to enable, disable and show the log
- Optimizations and bug fixes
- If you upgrade from v1, please use /opt/bolemo/script/firewall-blocklist clean before installing v2
- Better filtering rules.
- Prevents wan gateway and its defined netmask to be blocked
- Possible to log activity in sys log
- test command is replaced by info command
- Usage of colors in terminal
- Have now an upgrade function to download and install latest version
- install.sh now asks before overwriting existing firewall-blocklist.sources file.
- Version is displayed with status command
- Fixed creation of duplicate iptables rules overtime.
- Minor bug fixes
- Fixed the firewall-blocklist test that was returning an error if /opt/scripts does not exists at first. Since at this stage this directory might not exist, and since it is created if needed, testing this dir was unnecessary.
- if /opt/scripts/firewall-start.sh already exists, it won’t be replaced. Existing rules will be preserved.
- ipset generation is a lot faster
- no need to restart the script after a reboot
Last edited: