By using this Help Desk you permit HonestRepair to collect your email address and the data you provide so they can provide support for your ticket.

HonestRepair > HonestRepair Help Desk > Knowledgebase

Search help:

Block an IP address using UFW rules


Ubuntu FireWall (UFW) is just what it's name implies. It is also a wrapper for iptables.


To enable UFW.....

  • sudo ufw enable

To open specific ports.....

  • sudo ufw allow PORTNUMBER

To add a rule in a numbered format (allow rules specified BEFORE deny rules will override the deny rule, and vice-versa).....

  • sudo ufw insert 1 allow PORTNUMBER

To block packets coming from a specific IP.....

  • sudo ufw deny from IPADDRESS to any

To block packets going to a specific IP.....

  • sudo ufw deny to IPADDRESS from any



Special thanks to.....



Was this article helpful? yes / no
Article details
Article ID: 4
Category: Ubuntu
Date added: 2018-08-14 19:32:32
Rating (Votes): Article rated 4.0/5.0 (4)

« Go back

Powered by Help Desk Software HESK, in partnership with SysAid Technologies