AmazingCounters.com

Linux开启防火墙后,设置允许通过的端口

安装Firewall命令:

yum install firewalld firewalld-config

Firewall开启端口命令:

firewall-cmd --zone=public --add-port=80/tcp --permanent

Firewall关闭端口命令:

firewall-cmd --zone=public --remove-port=80/tcp --permanent

批量添加区间端口:

firewall-cmd --zone=public --add-port=4400-4600/tcp --permanent

开启防火墙命令:

systemctl start firewalld

重启防火墙命令:

systemctl restart firewalld

查看端口列表:

firewall-cmd --zone=public --list-ports

禁用防火墙:

systemctl stop firewalld

设置开机启动:

systemctl enable firewalld

停止并禁用开机启动:

sytemctl disable firewalld

查看防火墙状态:

systemctl status firewalld

 

亲测好使。。。

posted @ 2018-05-15 16:10  jacunjpg  阅读(115)  评论(0编辑  收藏