admin avatar

freebsd web服务器的防火墙配置

🕐 by admin





编辑以下文件,

/etc/rc.conf

添加下面的代码

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"

启动防火墙

service ipfw start

查看防火墙规则

ipfw list

测试防火墙规则

nmap -p 22,80 your ip

open则表示端口开放,反则表示过滤~

nmap官网

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





💘 相关文章





写一条评论

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