ufw Flags & Options
Uncomplicated Firewall front end.All ufw pages
- ufw --dry-run: preview the iptables rules a ufw command would createufw --dry-run shows the rules a ufw command would write without changing the firewall. Preview allow, delete, default and enable before locking yourself out.
- ufw insert 1 / ufw prepend: put a deny rule before existing allow rulesufw insert 1 and ufw prepend put a deny rule before existing allow rules, since ufw appends by default and the first match wins. When to use each, and pitfalls.
- ufw route allow: permit forwarded traffic between interfaces (VPN, Docker, routers)ufw route allow permits forwarded traffic between interfaces, for VPNs, containers and routers. Normal allow rules do not cover it; IP forwarding is needed too.
- ufw status numbered: list rules with numbers and delete one by numberufw status numbered lists rules with their positions so you can delete one with ufw delete NUM. Why IPv6 rules need a separate delete and numbers shift.