不乱于心,不困于情。
不畏将来,不念过往。如此,安好。

Centos7-防火墙(Firewall)开启常见端口命令

Centos7默认安装了firewalld,如果没有安装的话,则需要YUM命令安装;firewalld真的用不习惯,与之前的iptable防火墙区别太大。

安装Firewall命令:

yum install firewalld firewalld-config

Firewall开启常见端口命令:

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

firewall-cmd –zone=public–add-port=443/tcp –permanent

firewall-cmd –zone=public –add-port=22/tcp–permanent

firewall-cmd –zone=public–add-port=21/tcp –permanent

firewall-cmd –zone=public–add-port=53/udp –permanent

Firewall关闭常见端口命令:

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

firewall-cmd –zone=public–remove-port=443/tcp –permanent

firewall-cmd –zone=public–remove-port=22/tcp –permanent

firewall-cmd –zone=public–remove-port=21/tcp –permanent

firewall-cmd –zone=public–remove-port=53/udp –permanent

批量添加区间端口

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

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

开启防火墙命令:

systemctl start firewalld.service

重启防火墙命令:

firewall-cmd –reload  或者   service firewalld restart

查看端口列表:

firewall-cmd –permanent –list-port

禁用防火墙

systemctl stop firewalld

设置开机启动

systemctl enable firewalld

停止并禁用开机启动

sytemctl disable firewalld

查看状态

systemctl status firewalld或者firewall-cmd –state

赞(0) 打赏
未经允许不得转载:seo优化_前端开发_渗透技术 » Centos7-防火墙(Firewall)开启常见端口命令

相关推荐

  • 暂无文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏