#!/bin/sh -
#
#       $OpenBSD: ban.sh

#change AS Number to match your own AS Number on your BGP implementation
ASNUMBER=64511
# the command below runs bgpctl in rdomain  0 (for instances where a user
# is sshed in on the box and the ssh session is in a different rdomain / vrf 
/sbin/route -T0 exec /usr/sbin/bgpctl network add $1/32 community $ASNUMBER:666 community BLACKHOLE
echo network $1/32 has been banned indefinitely
echo run /usr/local/bin/unban.sh  $1 
echo to unblock the ip 
exit
