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.

8 lines
375 B

my_ip=$(ifconfig eth0 | grep 'inet' | cut -d: -f2 | awk '{print $2}')
sudo iptables -F
sudo timeout 2s tcpdump -i eth0 icmp and src $my_ip
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
sudo timeout 5s tcpdump -i eth0 icmp and src $my_ip