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.

20 lines
675 B

sudo apt update
sudo apt upgrade -y
sudo apt install tcpdump -y
worker1IP=$(ifconfig | grep inet | sed -n 1p | awk "{print \$2}" )
clear
sudo iptables -F
echo "Listening to ICMP replies from worker1 for 5 seconds"
sleep 2s
sudo timeout 5s tcpdump -i eth0 icmp and src $worker1IP
sleep 2s
echo "Applying Ip Tables Rules"
sleep 2s
sudo iptables -N icmp_flood
sudo iptables -A INPUT -p icmp -j icmp_flood
sudo iptables -A icmp_flood -m limit --limit 1/s --limit-burst 3 -j RETURN
sudo iptables -A icmp_flood -j DROP
echo "Listening to ICMP replies from worker1 for 5 seconds"
sleep 2s
sudo timeout 5s tcpdump -i eth0 icmp and src $worker1IP
echo "Spot any difference?"