You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
670 B

sudo apt update
sudo apt upgrade -y
#Find worker1 IP
worker1=$(ifconfig|grep inet|sed -n lp|awk "{print \$2}")
clear
sudo iptables -F
echo "2 sec ICMP packet sniffing"
sleep 2s
sudo timeout 2s tcpdump -i eth0 icmp $worker1
sleep 2s
echo "New iptables rules"
#clean iptables rules from previous script runs
sudo iptables -X
sudo iptables -N icmp_flood
sudo iptables -A INPUT -p icmp -j icmp_flood
#limit icmp_flood to 1 packets per second
sudo iptables -A icmp_flood -m limit --limit 1/s --limit-burst 3 -j RETURN
sudo iptables -A icmp_flood -j DROP
sleep 2s
echo "2 sec ICMP packet sniffing after iptables config"
sleep 2s
sudo timeout 2s tcpdump -i eth0 icmp $worker1