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

WRITEIP

CS:GO

This command saves the list of IPs that have been banned to banned_ip.cfg, so that the bans apply even after the server restarts.

Syntax
writeip

Description

This command saves the list of IPs that have been banned to banned_ip.cfg, so that the bans apply even after the server restarts.

Syntax And Arguments

writeip