setban
setban "subnet" "command" ( bantime absolute )
setban
allows you to add or remove an IP/Subnet from the banned list.
Argument #1 – subnet
Type: string, required
Specifies the IP/Subnet (refer to getpeerinfo
for the node’s IP) with an optional netmask (default is /32, meaning a single IP).
Argument #2 – command
Type: string, required
Use 'add'
to ban the IP/Subnet or 'remove'
to unban it.
Argument #3 – bantime
Type: numeric, optional, default=0
Specifies the ban duration in seconds, or, if [absolute] is set, until a specific time. If set to 0 or left empty, the default ban time is 24 hours, which can be changed using the -bantime
startup argument.
Argument #4 – absolute
Type: boolean, optional, default=false
If true, bantime
must be an absolute timestamp in UNIX epoch time.