admin avatar

Freebsd web server firewall configuration

🕒 by admin





Edit the following files,

/etc/rc.conf

Add the following code

1
2
3
4
5
6
7
firewall_enable = "YES"
firewall_quiet = "YES"
firewall_type = "workstation"
firewall_allowservices = "any"
firewall_myservices = "22 / tcp"
# firewall_myservices = "8080 / tcp 80 / tcp 443 / tcp"
firewall_logdeny = "YES"

Start firewall

service ipfw start

View firewall rules

ipfw list

Test firewall rules

nmap -p 22,80 your ip

open means the port is open, otherwise it means filtering ~

nmap official website

https://nmap.org/download.html?vpslala.com





💘 相关文章





写一条评论

Based on Golang + fastHTTP + sdb | go1.18.1 Processed in 2ms