Linux comes with firewall iptables basic use

Source: Internet
Author: User

---restore content starts---

Iptables-f Clear All Rules

Iptables-l Show All Rules

Iptables–p setting default Rules

Iptables-a input-j drop inputs and input data are not prompted

Iptables-a input-j REJECT inputs and input data are dropped to prompt for corresponding values or to terminate packet access

Iptables-a input-s localhost-j drop from (localhost) data is dropped (-s specifies the source "hostname/domain name")

Iptables-a input-p TCP--dport 80-j accept data from the TCP protocol 80 destination port all data is released or accepts all data from the TCP protocol 80 destination port

Iptables-a input-i network-j drop from the network all the data that came in from the network

Iptables-a output-p TCP--sport 80-j DROP data from TCP protocol 80 source port all disabled

Iptables-a opuput-o network-j DROP All data from the network is banned

Iptables-i input-s localhost DROP inserts a rule that prohibits localhost

Service iptables Save rules persist

Iptables-save >/etc/sysconfig/iptables Save rules

iptables-d INPUT Delete 1th rule

Iptables-l-N--line-number (-n Display network Listener) (--line-number display line number)

--dport Destination port (service port for localhost)

(Accept all data) (drop suppresses all data and does not prompt) (reject suppresses all data with a hint message)

(-I enters the number of network cards) (-o data card) (--sport Source port) (--dport Target Port)

---restore content ends---

Linux comes with firewall iptables basic 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.