linux的防火墙一般是iptables,还有一个是selinux,要开机关闭这两个方法如下:
1、开机不自动启动iptables使用命令:chkconfig iptalbes off命令
2、开机不启动selinux,需要更改文件
vi /etc/selinxu/config 和 vi /etc/sysconfig/selinux 两个文件,将其中的SELINUX=enforcing改为SELINUX=disabled
重启服务器即可。
开启端口 firewall-cmd --zone=public --add-port=80/tcp --permanent
命令含义:--zone #作用域
--add-port=80/tcp #添加端口,格式为:端口/通讯协议
--permanent #永久生效,没有此参数重启后失效
重启防火墙 firewall-cmd --reload