misc/debian/bullseye/notes/firewall-ufw.md

45 lines
1.3 KiB
Markdown
Executable File

Install ufw.
```
apt install ufw
```
Allow routed traffic.
```
ufw default allow routed
```
Allow DHCP Server
```
ufw allow bootps
ufw allow 53/udp
ufw allow 5355
ufw allow 53/tcp
```
Allow SSH from local addresses only.
```
ufw allow from 192.168.1.0/24 proto tcp to any port 22
ufw allow from 192.168.156.0/24 proto tcp to any port 22
ufw allow from 192.168.1.0/24 proto tcp to any port 80
ufw allow from 192.168.156.0/24 proto tcp to any port 80
ufw allow from 192.168.1.0/24 proto tcp to any port 8080
ufw allow from 192.168.156.0/24 proto tcp to any port 8080
ufw allow from 192.168.1.0/24 proto tcp to any port 443
ufw allow from 192.168.156.0/24 proto tcp to any port 443
ufw allow from 192.168.1.0/24 proto udp to any port 5060
ufw allow from 192.168.156.0/24 proto udp to any port 5060
ufw allow from 217.10.64.0/20 proto udp to any port 5060
ufw allow from 217.116.112.0/20 proto udp to any port 5060
ufw allow from 212.9.32.0/19 proto udp to any port 5060
ufw allow from 10.0.0.0/24 proto udp to any port 5060
ufw allow from 192.168.1.0/24 proto udp to any port 24000:26000
ufw allow from 192.168.156.0/24 proto udp to any port 24000:26000
ufw allow from 10.0.0.0/24 proto udp to any port 24000:26000
ufw allow in on wwan0 proto udp to any port 24000:26000
```
Enable ufw.
```
ufw enable
```