Hostxpeed
Login Get Started →
Security

How to Allow Specific IP in UFW

4 min read
33 views
Jun 10, 2026

Prerequisites

  • UFW installed and enabled
  • Root or sudo privileges

Step 1: Allow IP Address

sudo ufw allow from 192.168.1.100

Step 2: Allow IP to Specific Port

sudo ufw allow from 203.0.113.5 to any port 22

Step 3: Allow IP Range

sudo ufw allow from 192.168.1.0/24

Step 4: Reload and Verify

sudo ufw reload
sudo ufw status numbered

Was this article helpful?