Linux under the firewall to open a port number and firewall common command use

Source: Internet
Author: User
Common commands for Linux firewalls

1. Permanent effect, no recovery after reboot
Open: Chkconfigiptables on
OFF: Chkconfigiptables off
2. Immediate effect, recovery after restart
Restarting the firewall
Way One:/etc/init.d/iptables restart
Mode two: Service iptables restart
To turn off the firewall:
Mode one:/etc/init.d/iptables stop
Mode two: Service iptables stop
Start the firewall
Mode one:/etc/init.d/iptables start
Mode two: Service iptables start

Open related interfaces

1. Locate the firewall configuration file and modify
Directory in/etc/sysconfig/iptables
Add the line code to the inside, the code is as follows:
-A rh-firewall-1-input-p tcp-m state–state new-m tcp–dport 8088-j ACCEPT
This code must be placed above the following code
-A rh-firewall-1-input-j reject–reject-with icmp-host-prohibited, otherwise it will not work. Specific configuration files such as:

2. Restart the firewall for changes to take effect
Service Iptables Restart

Linux under the firewall to open a port number and firewall common command use

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.