一.Centos 6

1.防火墙开启关闭

[root@xuyj~] service iptables restart/start/stop

2.端口开放

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
#以8080端口为例
[root@xuyj~] /sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT  #写入修改
[root@xuyj~] /etc/init.d/iptables save   #保存修改
[root@xuyj~] service iptables restart    #重启防火墙,修改生效

二.Centos 7

1.防火墙开启关闭

[root@xuyj~] systemctl restart/start/stop firewalld.service

2.端口开放

#permanent 为永久
[root@xuyj~] firewall-cmd --zone=public --add-port=8388/tcp --permanen
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄