Iptables several commands

Source: Internet
Author: User

One example: Prohibit an IP access to the server on the online server.

Iptables-i INPUT 2-s 220.96.133.0/24-i em1-j DROP

Prepare: According to the firewall policy order of each server to adjust, my server needs to plug in the front input 2, if inserted in the other effective policy, it will not take effect.

Cancel: iptables-d input-s 220.96.133.0/24-i em1-j DROP


Example: Prohibit an IP to access a port on this server.

Iptables-i INPUT 2-s 220.96.133.135/32-p tcp--dport 80-j DROP

Cancel: iptables-d input-s 220.96.133.135/32-p tcp--dport 80-j DROP


Example: Allow an IP to access a port on this server.

Iptables-i input-s 220.96.133.135/32-p TCP--dport 80-j ACCEPT

Cancellation: iptables-d input-s 220.96.133.135/32-p tcp--dport 80-j ACCEPT


Available: The above INPUT 2, according to the policy order of each server since the adjustment.

Iptables several commands

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.