ufw-{deny, allow}: add ufw-deny page and update ufw-allow (#23425)

This commit is contained in:
Pradeep Tarakar
2026-08-03 02:33:10 +05:30
committed by GitHub
parent dec21ad2ac
commit 612bf9b551
2 changed files with 42 additions and 6 deletions
+10 -6
View File
@@ -5,24 +5,28 @@
- Allow all traffic on a port:
`ufw allow {{port}}`
`sudo ufw allow {{port}}`
- Allow traffic for a protocol on a port:
`ufw allow {{port}}/{{protocol}}`
`sudo ufw allow {{port}}/{{protocol}}`
- Allow incoming traffic for a protocol and add a comment for documentation:
`ufw allow in {{protocol}} comment '{{comment}}'`
`sudo ufw allow in {{protocol}} comment '{{comment}}'`
- Allow all traffic from a source address:
`ufw allow from {{source_address}}`
`sudo ufw allow from {{source_address}}`
- Allow all incoming traffic from the subnet 192.168.13.0/24:
`sudo ufw allow from 192.168.13.0/24`
- Allow TCP traffic from 192.168.1.12 to 192.168.1.100 on port 443:
`ufw allow from 192.168.1.12 to 192.168.1.100 port 443 proto tcp`
`sudo ufw allow from 192.168.1.12 to 192.168.1.100 port 443 proto tcp`
- Allow all incoming GRE traffic to 192.168.1.100 on the eth0 interface:
`ufw allow in on eth0 to 192.168.1.100 proto gre`
`sudo ufw allow in on eth0 to 192.168.1.100 proto gre`
+32
View File
@@ -0,0 +1,32 @@
# ufw deny
> Block traffic through the firewall.
> More information: <https://manned.org/ufw>.
- Deny all traffic on a port:
`sudo ufw deny {{port}}`
- Deny traffic for a protocol on a port:
`sudo ufw deny {{port}}/{{protocol}}`
- Deny incoming traffic for a protocol and add a comment for documentation:
`sudo ufw deny in {{protocol}} comment '{{comment}}'`
- Deny all traffic from a source address:
`sudo ufw deny from {{source_address}}`
- Deny all incoming traffic from the subnet 192.168.13.0/24:
`sudo ufw deny from 192.168.13.0/24`
- Deny UDP traffic from 192.168.1.12 to 192.168.1.100 on port 8080:
`sudo ufw deny from 192.168.1.12 to 192.168.1.100 port 8080 proto udp`
- Deny all incoming IGMP traffic to 192.168.1.100 on the eth0 interface:
`sudo ufw deny in on eth0 to 192.168.1.100 proto igmp`