ufw Allow From Specific IP on Specific Port

By | 2011/10/10

ufw is the friendly command line firewall utility in Debian and Ubuntu.

I’ll show you how to create a specific rule syntax for allowing traffic in from a specific ip on a specific port.

Say for example you want to allow traffic from on udp port 88.

Here is the command:

$ sudo ufw allow from proto udp to any port 88

You can view your current rules with:

$ sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
88/udp                     ALLOW

To delete this rule, preface the command with delete:

$ sudo ufw delete allow from proto udp to any port 88