We recommend a good iptables-shell script to free you from the troublesome iptables configuration. I am not sure who the script author is, so I deleted the version declaration. system: centos5.9 script content: viiptables. sh #! /Bin/sh # -----------
The code is as follows
Copy Code
#!/bin/sh#------------------------------------------------------------------------------# for debugging use Iptables-v.Iptables= "/sbin/iptables"Ip6tables= "/sbin/ip6tables"Modprobe=
1. Show the status of the firewallRun the following command with root privileges:
# iptables-l-n-v
Parameter description:
-L: Lists the rules.
-V: Displays detailed information. This option displays the interface name,
Instance:#iptables-T filter-a input-s 172.16.0.0/16-d 172.16.100.7-j Drop the source address of the 172.16.0.0 network segment, the access 172.16.100,7 packets are discarded.#iptables-L-N View rules for the filter table#iptables-T Nat-l-n View rules
The default script only enables port 80, 3306, and port 22 of the conventional web server # videfault_firewall.sh #! /Bin/bash #################################### ####################################### File: the default default_firewall.sh script
The default script only enables ports 80, and 22 of the conventional web server.
# Vi default_firewall.sh #! /Bin/bash######################################## ################################### File: default_firewall.sh# Description:# Language:
Security Service-iptablesI. Network Security Access ControlWe all know that Linux is generally used as a server and provides some network-based services. Generally, we need to perform some network control on the server,Similar to firewall
#防止SYN攻击, lightweight preventionIptables-n Syn-floodIptables-a input-p tcp–syn-j Syn-floodIptables-i syn-flood-p tcp-m limit–limit 3/s–limit-burst 6-j RETURNIptables-a syn-flood-j REJECT#防止DOS太多连接进来, you can allow up to 15 initial connections per IP
Http:// OS .51cto.com/art/201108/285352.htm
This document is intended for beginners of iptables. If you have just learned the principles and basic syntax of iptables, but you still do not know how to actually use this tool in the online server
# 1. Delete all existing rules
Iptables-f
# 2. Set the default chain policy
Iptables-p INPUT DROP
Iptables-p FORWARD DROP
Iptables-p OUTPUT DROP
# 3. Block a specific IP address
#BLOCK_THIS_IP = "x.x.x.x"
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.