To edit a firewall configuration file:
Vi/etc/sysconfig/iptables
Firewall boot:
Service Iptables Restart
If you are prompted not to have a configuration file, add one manually.
The main configuration is as follows:
# Firewall configuration written by System-config-firewall
# Manual Customization of this file are not recommended.
*filter
: INPUT ACCEPT [0:0]
: FORWARD ACCEPT [0:0]
: OUTPUT ACCEPT [0:0]
-A input-m state--state established,related-j ACCEPT
-A input-p icmp-j ACCEPT
-A input-i lo-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 22-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 21-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 10060:10090-j ACCEPT
-A input-j REJECT--reject-with icmp-host-prohibited
-A forward-j REJECT--reject-with icmp-host-prohibited
COMMIT
Open 21, 22 ports, if you want to open 80 ports, insert the following statement:
-A input-m state--state new-m tcp-p TCP--dport 80-j ACCEPT
Disable a port, such as 8080:
-A Input-p TCP--dport 8080-j DROP
Relatively brief, after a detailed study of the time.
Related article: CentOS6.5 's VSFTP construction process (i.)
Original link:centos6.5–iptables configuration file
Centos6.5–iptables configuration file