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

45 lines
1.3 KiB
Markdown
Raw Normal View History

2022-01-27 20:13:02 +00:00
Install ufw.
```
2022-01-03 23:08:56 +00:00
apt install ufw
2022-01-27 20:13:02 +00:00
```
2022-01-03 23:08:56 +00:00
2022-01-27 20:13:02 +00:00
Allow routed traffic.
```
2022-01-03 23:08:56 +00:00
ufw default allow routed
2022-01-27 20:13:02 +00:00
```
2022-01-03 23:08:56 +00:00
2022-01-27 20:13:02 +00:00
Allow DHCP Server
```
2022-01-03 23:08:56 +00:00
ufw allow bootps
ufw allow 53/udp
ufw allow 5355
2022-01-03 23:08:56 +00:00
ufw allow 53/tcp
2022-01-27 20:13:02 +00:00
```
2022-01-03 23:08:56 +00:00
2022-01-27 20:13:02 +00:00
Allow SSH from local addresses only.
```
2022-01-03 23:08:56 +00:00
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
2022-03-15 19:51:58 +00:00
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
2022-03-28 14:41:14 +00:00
ufw allow from 10.0.0.0/24 proto udp to any port 5060
2022-03-15 19:51:58 +00:00
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
2022-03-28 14:41:14 +00:00
ufw allow from 10.0.0.0/24 proto udp to any port 24000:26000
2022-04-03 20:03:44 +00:00
ufw allow in on wwan0 proto udp to any port 24000:26000
2022-01-27 20:13:02 +00:00
```
Enable ufw.
```
2022-01-03 23:08:56 +00:00
ufw enable
2022-01-27 20:13:02 +00:00
```