-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#!/bin/bash | ||
## Iptables 2016-07-21 | ||
## http://www.aqzt.com | ||
##email: [email protected] | ||
##robert yu | ||
##centos 7 | ||
## email: [email protected] | ||
## robert yu | ||
## centos 7 | ||
|
||
|
||
#查看 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
## Iptables 2016-09-23 | ||
## http://www.aqzt.com | ||
## email: [email protected] | ||
## robert yu | ||
## centos 6 | ||
## iptables 流量限制,可以通过调整--limit-burst 10值来控制流入 流出 | ||
/sbin/iptables -F | ||
|
||
/sbin/iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT | ||
/sbin/iptables -A INPUT -s 127.0.0.1 -j ACCEPT | ||
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | ||
/sbin/iptables -A INPUT -s 192.168.1.111 -j ACCEPT | ||
/sbin/iptables -A INPUT -s 192.168.1.112 -j ACCEPT | ||
/sbin/iptables -A INPUT -p tcp --dport 22 -j ACCEPT | ||
/sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT | ||
/sbin/iptables -A INPUT -s 192.168.56.101 -m limit --limit 2400/s --limit-burst 10 -j ACCEPT | ||
/sbin/iptables -A INPUT -s 192.168.56.101 -j DROP | ||
/sbin/iptables -A FORWARD -d 192.168.56.101 -m limit --limit 2400/s --limit-burst 10 -j ACCEPT | ||
/sbin/iptables -A FORWARD -d 192.168.56.101 -j DROP | ||
/sbin/iptables -A FORWARD -s 192.168.56.101 -m limit --limit 2400/s --limit-burst 10 -j ACCEPT | ||
/sbin/iptables -A FORWARD -s 192.168.56.101 -j DROP | ||
/sbin/iptables -A OUTPUT -s 192.168.56.101 -m limit --limit 2400/s --limit-burst 10 -j ACCEPT | ||
/sbin/iptables -A OUTPUT -s 192.168.56.101 -j DROP | ||
/sbin/iptables -A INPUT -j REJECT | ||
/sbin/iptables -A FORWARD -j REJECT | ||
/sbin/iptables -A OUTPUT -j ACCEPT | ||
|
||
/sbin/service iptables save | ||
echo ok |