iptables Firewall Security Configuration

Source: Internet
Author: User
Tags ssh iptables server port firewall

Iptables-f Clear all rule chains

Iptables-x Delete specific manually-set chains

Iptables-z Empty counter

Iptables-p input drop//default input rule Discard

Iptables-p output drop//default output rule Discard

Iptables-p FORWARD drop//default FORWARD rule Discard

Iptables-a input-d 192.168.10.250-p tcp-m tcp--dport 22-j//Open SSH Service inbound port

Iptables-a input-d 192.168.10.250-p tcp-m tcp--dport 80-j//Open Web Service Inbound port

Iptables-a input-s 127.0.0.1-d 127.0.0.1-j ACCEPT//allow local loopback data

Iptables-a input-p udp-m UDP--sport 53-j ACCEPT//Data packets from remote DNS server port 53 inbound through

Iptables-a input-p udp-m UDP--dport 53-j ACCEPT/Inbound packets into local server port 53

Iptables-a input-d 192.168.10.250-p icmp-j ACCEPT Packet access to local server

Iptables-a output-s 192.168.10.250-p tcp-m TCP--sport 22-m State--state established-j ACCEPT//access to SSH service packets open Outbound port

Iptables-a output-s 192.168.10.250-p tcp-m TCP--sport 80-m State--state established-j ACCEPT//data packets entered into the Web service open outbound port

Iptables-a output-s 127.0.0.1-d 127.0.0.1-j ACCEPT//allow local loopback data

Iptables-a output-p udp-m UDP--sport 53-j ACCEPT/Outbound data packets from local 53 ports out of the station through

Iptables-a output-p udp-m UDP--dport 53-j ACCEPT//Go to Remote DNS server port 53 packets outbound through

Iptables-a output-s 192.168.10.250-p icmp-j ACCEPT//ICMP packet response to each other (ping command response packet)

Service Iptables save//Save configuration information

Service iptables start//Open Firewall services

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/Network/Firewall/

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.