net_breaker.sh 287 B

1234567891011121314151617
  1. #!/bin/sh
  2. set -e
  3. if [ $1 = "BreakCommCmd" ]
  4. then
  5. iptables -A INPUT -s $2 -j DROP >/dev/null 2>&1
  6. iptables -A OUTPUT -s $2 -j DROP >/dev/null 2>&1
  7. iptables -A INPUT -m pkttype --pkt-type multicast -j DROP
  8. fi
  9. if [ $1 = "FixCommCmd" ]
  10. then
  11. iptables -F >/dev/null 2>&1
  12. fi
  13. exit 0