Fail2ban is great until it bans you. Type your password wrong a few times from the couch, or let a misconfigured script hammer a login, and your own laptop ends up on the block list. I’d tell fail2ban up front which addresses are mine.
Put it in /etc/fail2ban/jail.local, never in jail.conf. The man page says the .conf files belong to the package and should stay unchanged, and that .local files are read after them and win:
[DEFAULT]
ignoreip = 127.0.0.1/8 ::1 192.168.1.0/24 100.64.0.0/10
sudo fail2ban-client reload
sudo fail2ban-client get sshd ignoreip
ignoreip takes single addresses, CIDR ranges and DNS names, separated by spaces or commas. In the example 192.168.1.0/24 is the home LAN and 100.64.0.0/10 is the range Tailscale hands out, which makes sense if, like me, you reach your machines over Tailscale. ignoreself is on by default, so the server’s own addresses are already skipped. The second command asks a running jail which addresses it ignores, a nice way to check that your change landed.
Two caveats. If you also set ignoreip inside a jail section such as [sshd], that line replaces the one from [DEFAULT] for that jail, so repeat your ranges there. And every address on this list can guess passwords forever. A whole LAN is fine for a home server, but I wouldn’t add a big public range or a shared office network just to save myself a ban.
Further reading: jail.conf manual page, fail2ban default jail.conf on GitHub