Iptables (Linux Firewall)

Source: Internet
Author: User

1. install the software package

Use the ISO image in the virtual machine to install the corresponding software package

Rpm-q iptables (check whether this service is installed)

Ii. Start the linux Firewall

Service Startup Script:/etc/rc. d/sysconfig/iptables [srat/stop/retsart]

Service iptables restart

# System-config-securitylevel-tui (Firewall Configuration tool)

Iii. Related Documents

(1) configuration file:/etc/sysconfig/iptables-config

(2) side configuration file:/etc/sysconfig/iptablses (this file does not exist in the original system. You need to create a package for filtering and save the firewall policy, save the Command service iptables save service iptablse restart)

Iv. Operation object

(1) rule table: composed of Rule chains

Fileter (default): Packet Filtering

Nat: Address Translation

Mangles: Policy Routing

(2) Rule chain: composed of rules

(3) rule: the most basic setting item, used to Set firewall policies

5. iptables syntax Overview

BASIC script: iptabales-F (clear all packet filtering rules)

Iptablse-X (clear all data links)

Iptables-Z (counters are cleared)

Iptalbes-a input-I eth0-p tcp -- dport 80-j ACCEPT allows external machines to access the web of the server

Iptables-a input-I eht0-p tcp -- dport 22-j ACCEPT enable SSH access

Service iptablse save

Service iptabalse restart

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.