Freebsd 如何_打开_关闭_查看防火墙

在FreeBSD服务器上调试ipfw防火墙规则的时候,有时候需要临时关闭ipfw防火墙,可以使用如下命令来进行操作:

1)停止ipfw防火墙:

ipfw disable firewall

/etc/rc.d/ipfw stop

2)开启ipfw防火墙:

ipfw enable firewall

/etc/rc.d/ipfw start

随机器启动自动启用防火墙方法需要修改/etc/rc.conf文件,参考:http://blog.haohtml.com/archives/9309第三步.

3)如何查看ipfw是否在运行

方法一:通过ipfw -a list 不断的去看包的数量

方法二:sysctl -a | grep net.inet.ip.fw.enable

如果状态是1表示是开启,0为关闭.

ipfw中文手册pdf:http://docs.haohtml.com/download/freebsd/ipfw_zh.pdf

One thought on “Freebsd 如何_打开_关闭_查看防火墙

  1. Pingback: FreeBSD IPFW 防火墙的安装和设置 – 源码巴士

Comments are closed.