# How to block an ip?

**URL:** https://forum.yunohost.org/t/how-to-block-an-ip/3994
**Category:** Support
**Tags:** english
**Created:** [December 22, 2017, 1:28am UTC](https://forum.yunohost.org/t/how-to-block-an-ip/3994 "2017-12-22T01:28:34Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![yurone](https://forum.yunohost.org/user_avatar/forum.yunohost.org/yurone/32/646_2.png) [@yurone](https://forum.yunohost.org/u/yurone)
#### Post date: [December 22, 2017, 1:28am UTC](https://forum.yunohost.org/t/how-to-block-an-ip/3994/1 "2017-12-22T01:28:34Z")

</div>

hi,

i am using WP and i see that there is one ip that constantely try to acess to my server admin interface…  
and it getting blocked after trying to guess password ( i see it with a help of wordfence plugin…)

1 . what is the best way to block it ?

like this ?  
iptables -A INPUT -s IP—ADRESS -j DROP

1. will this stay after reboot ? i don’t remember how to save it forever 😉

---

<div class="post-metadata">

### Author: ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)
#### Post date: [December 22, 2017, 1:36am UTC](https://forum.yunohost.org/t/how-to-block-an-ip/3994/2 "2017-12-22T01:36:07Z")

</div>

Hm, I don’t know if it’s being catched by fail2ban ? But if it is, instead of manually messing with iptables (which is a complicated tool) I would rather recommend enabling the “recidive” jail in fail2ban

---

<div class="post-metadata">

### Author: ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)
#### Post date: [December 22, 2017, 11:11am UTC](https://forum.yunohost.org/t/how-to-block-an-ip/3994/3 "2017-12-22T11:11:06Z")

</div>

> [@Aleks](#):
>
> Hm, I don’t know if it’s being catched by fail2ban ?

Not yet, but I work on it.

---

<div class="post-metadata">

### Author: ![yurone](https://forum.yunohost.org/user_avatar/forum.yunohost.org/yurone/32/646_2.png) [@yurone](https://forum.yunohost.org/u/yurone)
#### Post date: [December 25, 2017, 1:06am UTC](https://forum.yunohost.org/t/how-to-block-an-ip/3994/4 "2017-12-25T01:06:12Z")

</div>

nobody can reply do my question ?

---

<div class="post-metadata">

### Author: ![genma](https://forum.yunohost.org/user_avatar/forum.yunohost.org/genma/32/746_2.png) [@genma](https://forum.yunohost.org/u/genma)
#### Post date: [December 27, 2017, 4:29pm UTC](https://forum.yunohost.org/t/how-to-block-an-ip/3994/5 "2017-12-27T16:29:26Z")

</div>

Actually, it seems there’s a work to plug Wordpress to fail2ban.

You can ban the IP via fail2ban. Don’t actually know how to do this, I think we can find some tutorials about it.

---

<div class="post-metadata">

### Author: ![kanhu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kanhu/32/3518_2.png) [@kanhu](https://forum.yunohost.org/u/kanhu)
#### Post date: [December 30, 2017, 4:56am UTC](https://forum.yunohost.org/t/how-to-block-an-ip/3994/6 "2017-12-30T04:56:37Z")

</div>

@yurone  
You can use the script using ipset [https://github.com/trick77/ipset-blacklist](https://github.com/trick77/ipset-blacklist)  
Maybe we can implement this script with YunoHost to ease to ban ip’s and limit access.

---

<div class="post-metadata">

### Author: ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)
#### Post date: [January 18, 2023, 8:16pm UTC](https://forum.yunohost.org/t/how-to-block-an-ip/3994/7 "2023-01-18T20:16:14Z")

</div>


