You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
3.6 KiB

  1. # banIP - ban incoming and/or outgoing ip adresses via ipsets
  2. ## Description
  3. IP address blocking is commonly used to protect against brute force attacks, prevent disruptive or unautherized address(es) from access or it can be used to restrict access to or from a particular geographic area — for example.
  4. ## Main Features
  5. * support many IP blocklist sources (free for private usage, for commercial use please check their individual licenses):
  6. * zero-conf like automatic installation & setup, usually no manual changes needed
  7. * supports six different download utilities: uclient-fetch, wget, curl, aria2c, wget-nossl, busybox-wget
  8. * Really fast downloads & list processing as they are handled in parallel as background jobs in a configurable 'Download Queue'
  9. * provides 'http only' mode without installed ssl library for all non-SSL blocklist sources
  10. * full IPv4 and IPv6 support
  11. * ipsets (one per source) are used to ban a large number of IP addresses
  12. * supports blocking by ASN numbers
  13. * supports blocking by iso country codes
  14. * supports local white & blacklist (IPv4, IPv6 & CIDR notation), located by default in /etc/banip/banip.whitelist and /etc/banip/banip.blacklist
  15. * auto-add unsuccessful ssh login attempts to local blacklist
  16. * auto-add the uplink subnet to local whitelist
  17. * per source configuration of SRC (incoming) and DST (outgoing)
  18. * integrated IPSet-Lookup
  19. * integrated RIPE-Lookup
  20. * blocklist source parsing by fast & flexible regex rulesets
  21. * minimal status & error logging to syslog, enable debug logging to receive more output
  22. * procd based init system support (start/stop/restart/reload/status)
  23. * procd network interface trigger support
  24. * output comprehensive runtime information via LuCI or via 'status' init command
  25. * strong LuCI support
  26. * optional: add new banIP sources on your own
  27. ## Prerequisites
  28. * [OpenWrt](https://openwrt.org), tested with the stable release series (18.06) and with the latest snapshot
  29. * a download utility:
  30. * to support all blocklist sources a full version (with ssl support) of 'wget', 'uclient-fetch' with one of the 'libustream-*' ssl libraries, 'aria2c' or 'curl' is required
  31. * for limited devices with real memory constraints, banIP provides also a 'http only' option and supports wget-nossl and uclient-fetch (without libustream-ssl) as well
  32. ## Installation & Usage
  33. * install 'banip' (_opkg install banip_)
  34. * at minimum configure the needed IP blocklist sources, the download utility and enable the banIP service in _/etc/config/banip_
  35. * control the banip service manually with _/etc/init.d/banip_ start/stop/restart/reload/status or use the LuCI frontend
  36. ## LuCI banIP companion package
  37. * it's recommended to use the provided LuCI frontend to control all aspects of banIP
  38. * install 'luci-app-banip' (_opkg install luci-app-banip_)
  39. * the application is located in LuCI under 'Services' menu
  40. ## Examples
  41. **receive banIP runtime information:**
  42. <pre><code>
  43. /etc/init.d/banip status
  44. ::: banIP runtime information
  45. + status : enabled
  46. + version : 0.0.5
  47. + fetch_info : /bin/uclient-fetch (libustream-ssl)
  48. + ipset_info : 3 IPSets with overall 29510 IPs/Prefixes
  49. + last_run : 08.11.2018 15:03:50
  50. + system : GL-AR750S, OpenWrt SNAPSHOT r8419-860de2e1aa
  51. </code></pre>
  52. **cronjob for a regular block list update (/etc/crontabs/root):**
  53. <pre><code>
  54. 0 06 * * * /etc/init.d/banip reload
  55. </code></pre>
  56. ## Support
  57. Please join the banIP discussion in this [forum thread](https://forum.openwrt.org/t/banip-new-project-needs-testers-feedback/16985) or contact me by mail <dev@brenken.org>
  58. ## Removal
  59. * stop all banIP related services with _/etc/init.d/banip stop_
  60. * optional: remove the banip package (_opkg remove banip_)
  61. Have fun!
  62. Dirk