UFW Firewall
Is a simplewall for Linux systems
Setup¶
- A good tutorial here
- Install
sudo apt install ufw
- Configuration
- Check status & list configuration
sudo ufw status
- Set default incoming to deny
ufw default deny incoming
andufw default allow outgoing
for instance
- Check status & list configuration
- Allow something
- Allow a port
sudo ufw allow PORT
- Allow a port from specific source
sudo ufw allow from 192.168.0.0/24 to any port YYY
- and a protocol
… to any port 100:200 proto tcp
- and a protocol
- Rate limit a port (>6 connections within 30 sec)
sudo ufw limit PORT
PORT
can be replaced with a known app likeSSH
or specific protocol likePORT/tcp
- Allow a port
- Remove something
- Remove an allowance
sudo ufw delete allow PORT
orsudo ufw delete RULE_NUMBER
- Remove an allowance
- Enable
- Enable
sudo ufw enable
- On alpine
rc-update add ufw default
- Enable
- Verify
- Check added rules
sudo ufw show added
- Check existing rules with numbers
sudo ufw status numbered
- Check added rules