NB! It seems this console command is not compatible with CS2.
Command Profile

ADDIP

CS:GO

This console command bans the specified IP from the server for the specified amount of minutes. Specify 0 as the amount of minutes to ban permanently.

Syntax
addip [Minutes Banned] [IP Address]

Description

This console command bans the specified IP from the server for the specified amount of minutes. Specify 0 as the amount of minutes to ban permanently.

How To Use addip

  1. Enable the developer console in Counter-Strike settings.
  2. Open the console with the tilde key (~).
  3. Enter addip [Minutes Banned] [IP Address], replacing bracketed arguments with the value you want, then press Enter.

This legacy command is not currently listed as compatible with Counter-Strike 2.

Syntax And Arguments

addip [Minutes Banned] [IP Address]
Minutes Banned The number of minutes you want to ban somebody for. Use the value 0 for a permanent ban. Entering 60 here would ban someone for an hour.
IP Address The IP address you want to add to the server's ban list (i.e. the IP address to ban).

Related Commands