Centos Boot iptables Firewall policy

Source: Internet
Author: User

Operating Environment Centos6.7

[Email protected] ~]# vim ipt.sh


#!/bin/bash

ipt= "/sbin/iptables"

$ipt-F

$ipt-P INPUT ACCEPT

# $ipt-T nat-p INPUT DROP

$ipt-P OUTPUT ACCEPT

$ipt-A input-p tcp-s 10.0.0.1--dport 20-j ACCEPT

$ipt-A input-p tcp-s 255.10.10.0/26--dport 20-j ACCEPT

$ipt-I input-p tcp-s 20.0.0.1--sport 10-d 192.16.1.235--dport 20-j DROP


[[email protected] ~]# vim/etc/rc.d/rc.local--Modify the CentOS boot entry

Add/bin/sh/root/ipt.sh---Guaranteed to start ipt.sh Firewall policy every time you restart

This article is from the "Ming blog" blog, please be sure to keep this source http://4408149.blog.51cto.com/4398149/1729325

Centos Boot iptables Firewall policy

Related Article

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.