Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # For Debian-based systems
- # Add this to your .bashrc
- banip() {
- if [ -z $1 ]
- then
- echo "Parameter not passed."
- else
- iptables -A INPUT -s $1 -j DROP
- iptables -A OUTPUT -d $1 -j DROP
- echo "$1 banned."
- #If you get an error, switch the comment out below
- #/etc/init.d/iptables save
- iptables-save
- fi
- }
- #usage: banip XX.XX.XX.XX
- # Blocks incoming and outgoing connections to a given IP or subnet
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement