added iptables samples
This commit is contained in:
10
iptables/limit.sh
Executable file
10
iptables/limit.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
IPTABLES="sudo /sbin/iptables"
|
||||||
|
|
||||||
|
$IPTABLES --new-chain RATE-LIMIT
|
||||||
|
$IPTABLES --append INPUT --match conntrack --ctstate NEW --jump RATE-LIMIT
|
||||||
|
$IPTABLES --append RATE-LIMIT --match limit --limit 5/sec --limit-burst 20 --jump ACCEPT #5 packages per second
|
||||||
|
$IPTABLES --append RATE-LIMIT --jump DROP
|
||||||
|
|
||||||
|
echo "iptables input chain is now rate limiting"
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# @Author: Anton Bracke <anton>
|
|
||||||
# @Date: 2019-05-03T00:05:51+02:00
|
|
||||||
# @Last modified by: anton
|
|
||||||
# @Last modified time: 2019-05-03T00:05:51+02:00
|
|
||||||
19
iptables/reset.sh
Normal file → Executable file
19
iptables/reset.sh
Normal file → Executable file
@@ -1,4 +1,15 @@
|
|||||||
# @Author: Anton Bracke <anton>
|
#! /bin/bash
|
||||||
# @Date: 2019-05-03T00:05:40+02:00
|
|
||||||
# @Last modified by: anton
|
IPTABLES="sudo /sbin/iptables"
|
||||||
# @Last modified time: 2019-05-03T00:05:40+02:00
|
|
||||||
|
$IPTABLES -F
|
||||||
|
$IPTABLES -X
|
||||||
|
$IPTABLES -t nat -F
|
||||||
|
$IPTABLES -t nat -X
|
||||||
|
$IPTABLES -t mangle -F
|
||||||
|
$IPTABLES -t mangle -X
|
||||||
|
$IPTABLES -P INPUT ACCEPT
|
||||||
|
$IPTABLES -P FORWARD ACCEPT
|
||||||
|
$IPTABLES -P OUTPUT ACCEPT
|
||||||
|
|
||||||
|
echo "iptables reseted"
|
||||||
|
|||||||
Reference in New Issue
Block a user