centos-7相关命令:
查看21端口是否开放命令:
[root@localhost admin]# firewall-cmd --query-port=21/tcp开放21端口命令:
[root@localhost admin]# firewall-cmd --zone=public --add-port=80/tcp --permanent开放端口之后需要重启防火墙才可以生效:
[root@localhost admin]# firewall-cmd reload或者:
[root@localhost admin]# systemctl stop firewalld.service
[root@localhost admin]# systemctl start firewalld.service