SG UFW Command Generator

SanchitGurukul Networking Tool

UFW Command Generator

Build safe, readable UFW firewall commands for services, ports, IP addresses, subnets, interfaces and routed traffic.

Safety reminder: When managing a remote server, allow SSH from your trusted IP before enabling UFW. Review every generated command before running it.

1. Choose operation

2. Define traffic

Quick presets

Common UFW combinations and examples

Recommended safe server setup
  1. sudo ufw default deny incoming
  2. sudo ufw default allow outgoing
  3. sudo ufw allow from YOUR_PUBLIC_IP to any port 22 proto tcp comment 'Trusted SSH'
  4. sudo ufw enable
  5. sudo ufw status verbose

Replace YOUR_PUBLIC_IP before enabling the firewall. Cloud-provider security groups may also need matching rules.

Your feedback matters

Was this post helpful?

0 reactions