阿里雲centos7 用iptables 開啟80埠
阿新 • • 發佈:2019-02-09
1、安裝iptables:yum install iptables-services(阿里雲centos7 預設 是使用的firewall,所以要使用iptables需先安裝)
2、相看filrwall是否關閉:
檢視:systemctl status firewalld
啟動: systemctl start firewalld
關閉: systemctl stop firewalld
開機禁用 : systemctl disable firewalld
開機啟用 : systemctl enable firewalld
3、把埠加入到iptables中(加入之前,可使用iptables -L -n檢視埠情況)
指令:vim /etc/sysconfig/iptables
4、重啟iptables:systemctl restart iptables.service(重啟後,使用 iptables -L -n檢視)
5、OK後,還需在阿里雲控制檯上, 新增安全組規則。