# How to use ipfw to block an ip for a specified time on freebsd12



## dashen (Nov 15, 2022)

How to use ipfw to block an ip for a specified time on FreeBSD 12.

I am currently using iptables+ipset, which can block an ip for a specified time.

```
ipset create blacklist hash:ip timeout 3600
iptables -A INPUT -p tcp -m set --match-set blacklist src -m multiport --dports 443,80 -j DROP

ipset add blacklist 192.168.10.1 （This IP will be blocked for 3600 seconds）
```
Can I use ipfw to achieve the above functions, thank you


----------



## VladiBG (Nov 15, 2022)

Check security/py-fail2ban


----------

