Modify Linux firewall rules

Source: Internet
Author: User

In the company, the fourth time to modify the "firewall rules", tidy up a bit.

Note: The change on the command line is temporary and requires some action to keep the rule forever, making it always effective.

========================

1, the first step, first look at the server "firewall rules":

Iptables-l

IPTABLES-L-n//Plus one-n displays IP and ports in digital form and looks more comfortable

iptables-l-N--line-number //delete, need to use this, this bar can see each firewall rule number

2. Add a rule:

I am here for the future ES 9200 port, can be accessed by people, so need to add firewall rules:

Iptables-i INPUT 1-p TCP--dport 9200-j ACCEPT//Add (-i) a rule on the first line: TCP port number 9200 allow (ACCEPT) access

3. Delete a firewall rule

iptables-l-N--line-number //delete, need to use this, this bar can see each firewall rule number

iptables-d INPUT 1//delete (-D) First line of firewall rules

4, the most important step, after modifying the firewall rules, you need to save:

Service Iptables Save

Modify Linux firewall rules

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.