mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-09 19:57:59 +00:00
Move pages under tldr, lint run.sh, update docs
This commit is contained in:
42
tldr/linux/ufw
Normal file
42
tldr/linux/ufw
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ufw
|
||||
|
||||
> Uncomplicated Firewall.
|
||||
> Frontend for `iptables` aiming to make configuration of a firewall easier.
|
||||
> More information: <https://wiki.ubuntu.com/UncomplicatedFirewall>.
|
||||
|
||||
- Enable ufw:
|
||||
|
||||
`ufw enable`
|
||||
|
||||
- Disable ufw:
|
||||
|
||||
`ufw disable`
|
||||
|
||||
- Show ufw rules, along with their numbers:
|
||||
|
||||
`ufw status numbered`
|
||||
|
||||
- Allow incoming traffic on port 5432 on this host with a comment identifying the service:
|
||||
|
||||
`ufw allow {{5432}} comment "{{Service}}"`
|
||||
|
||||
- Allow only TCP traffic from 192.168.0.4 to any address on this host, on port 22:
|
||||
|
||||
`ufw allow proto {{tcp}} from {{192.168.0.4}} to {{any}} port {{22}}`
|
||||
|
||||
- Deny traffic on port 80 on this host:
|
||||
|
||||
`ufw deny {{80}}`
|
||||
|
||||
- Deny all UDP traffic to ports in range 8412:8500:
|
||||
|
||||
`ufw deny proto {{udp}} from {{any}} to {{any}} port {{8412:8500}}`
|
||||
|
||||
- Delete a particular rule. The rule number can be retrieved from the `ufw status numbered` command:
|
||||
|
||||
`ufw delete {{rule_number}}`
|
||||
Reference in New Issue
Block a user