Banning a Country in KeyHelp

Discussions about the usage of KeyHelp.
User avatar
Alexander
Keyweb AG
Posts: 4448
Joined: Wed 20. Jan 2016, 02:23

Re: Banning a Country in KeyHelp

Post by Alexander »

Regarding the limitations by KeyHelp, you can use up to 16.777.215 characters in total.

Lets assume, all IPv4 address (+masks) have this format (including comma).

"XXX.XXX.XXX.XXX/XX," = 19 characters

16.777.215 / 19 = 883.011

So you would be able to use 883.011 IPv4 addresses

Note:
- This does not take into account IPv6 addresses
- I have not checked if there are limits by IPTables (so you probably can use less addresses)
- Like pointed out, this could become rather inefficient to handle (on the firewall end, as well as in the UI).
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Chalipa
Posts: 33
Joined: Sun 19. Mar 2023, 04:03

Re: Banning a Country in KeyHelp

Post by Chalipa »

Alexander wrote: Mon 20. Jan 2025, 10:20 Regarding the limitations by KeyHelp, you can use up to 16.777.215 characters in total.

Lets assume, all IPv4 address (+masks) have this format (including comma).

"XXX.XXX.XXX.XXX/XX," = 19 characters

16.777.215 / 19 = 883.011

So you would be able to use 883.011 IPv4 addresses

Note:
- This does not take into account IPv6 addresses
- I have not checked if there are limits by IPTables (so you probably can use less addresses)
- Like pointed out, this could become rather inefficient to handle (on the firewall end, as well as in the UI).

So, just to make sure I have understood this correctly:

883 IPv4 can be saved in EACH RULE in the firewall to ensure its proper operation.


Correct?
User avatar
Jolinar
Community Moderator
Posts: 4003
Joined: Sat 30. Jan 2016, 07:11
Location: Weimar (Thüringen)
Contact:

Re: Banning a Country in KeyHelp

Post by Jolinar »

Chalipa wrote: Wed 22. Jan 2025, 00:19 So, just to make sure I have understood this correctly:
883 IPv4 can be saved in EACH RULE in the firewall to ensure its proper operation.
Correct?
No!
Please read carefully again!
Alexander wrote: Mon 20. Jan 2025, 10:20 So you would be able to use 883.011 IPv4 addresses
Wenn jemand inkompetent ist, dann kann er nicht wissen, daß er inkompetent ist. (David Dunning)

Data Collector für Community Support
___
Ich verwende zwei verschiedene Schriftfarben in meinen Beiträgen /
I use two different font colors in my posts:
  • In dieser Farbe schreibe ich als Moderator und gebe moderative Hinweise oder begründe moderative Eingriffe /
    In this color, I write as a moderator and provide moderative guidance or justify moderative interventions
  • In dieser Farbe schreibe ich als Community Mitglied und teile meine private Meinung und persönlichen Ansichten mit /
    In this color, I write as a community member and share my personal opinions and views
User avatar
24unix
Posts: 2037
Joined: Sun 21. Jun 2020, 17:16
Location: Kollmar
Contact:

Re: Banning a Country in KeyHelp

Post by 24unix »

Mind the difference between dot and comma.
Cheers Micha
--
A Windows user reinstalls software every few weeks.
A Linux user reinstalls software every few weeks.
The difference is with Linux the version numbers change.
User avatar
Tobi
Community Moderator
Posts: 3230
Joined: Thu 5. Jan 2017, 13:24

Re: Banning a Country in KeyHelp

Post by Tobi »

Is it possible to place plain TXT files with IPs to ban and include these files in the KeyHelp setup?

With this setup one could ban a whole country within the file „countryland.txt“ and „anotherland.txt“ and so on.
Gruß,
Tobi


-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
User avatar
Ralph
Posts: 1245
Joined: Mon 30. Mar 2020, 16:14

Re: Banning a Country in KeyHelp

Post by Ralph »

Tobi wrote: Thu 5. Jun 2025, 16:52 Is it possible to place plain TXT files with IPs to ban and include these files in the KeyHelp setup?
If possible, use an external FW and turn off the internal one. This prevents the ipset rules from being deleted in the event of a FW flush.
It causes less load when reloading (restore) the blacklists with many IP addresses ... country blocks can be loaded once at system startup via cronjob; they do not need to be updated constantly.
If no external FW is available, then a script would have to be executed after a flush to reload and activate your ipsets.
User avatar
Tobi
Community Moderator
Posts: 3230
Joined: Thu 5. Jan 2017, 13:24

Re: Banning a Country in KeyHelp

Post by Tobi »

I don‘t want to disable the KeyHelp firewall.
I want to extend the KeyHelp firewall.

As you said, contry-Ip-ranges don‘t need to be updated very often.
Gruß,
Tobi


-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
Post Reply