Enable Firewall in centos 5.6

Source: Internet
Author: User

Centos 5.6 can open the firewall normally through the interface, but it is often ineffective when you use commands to open the firewall. Currently, it is always possible that the parameters are incorrect. I reorganized the two methods and wrote down the steps.

1. Use the command to modify:

(We recommend that you change IPTABLES_SAVE_ON_STOP = "no" to yes in etc/sysconfig/iptables-config)

1./sbin/iptables-I INPUT-p tcp -- dport 2003-j ACCEPT

2./etc/rc. d/init. d/iptables save or service iptables save

3 service iptables restart

2. Modify etc/sysconfig/iptables

1. service iptables stop (if this step is missing, after this operation, the system will be restarted, and etc/sysconfig/iptables will be restored. )

2. Add A line after etc/sysconfig/iptables-A RH-Firewall-1-INPUT-p tcp-m state -- state NEW-m tcp -- dport 2002-j ACCEPT

3./etc/rc. d/init. d/iptables save or service iptables save

4. service iptables restart

5./etc/rc. d/init. d/iptables save or service iptables save (save again)

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.