Preface:
The default iptables configuration on CentOS or RHEL does not allow access to the HTTP (TCP PORT # 80) and HTTPS (TCP PORT # 443) ports used by the Apache web server. You can modify settings using any one of the following three methods.
Method # 1: Edit /etc/sysconfig/iptables file (recommend for advanced users)
Edit the IPv4 /etc/sysconfig/iptables, enter:
Ps. 如果是 IPv6, 編輯 /etc/sysconfig/ip6tables 並使用命令 ip6tables 重啟.
Method # 2: Firewall configuration GUI/TUI tool (recommend for new users)
The sysystem-config-firewall-tui is a command line tool without having the GUI installed on the server:
Select Enabled and Press Tab to select "Customization" :
Scroll down/up and select SSH, WWW, Secure WWW (HTTPS) and other required ports you wish to open. Finally, select Close button. Finally, press OK button to activate new firewall settings.
Method # 3: iptables command line utility (recommend for advanced/expert users only)
Type the following iptables command as root user to open port 80 / 443:
The following rule allows access to port 80 and 443 only to 192.168.1.0/24
Supplement:
* HowTo Disable The Iptables Firewall in Linux
* CentOS / Redhat Iptables Firewall Configuration Tutorial
* Linux: 20 Iptables Examples For New SysAdmins
* Linux Configure Firewall Using Shorewall Under RHEL / CentOS
沒有留言:
張貼留言