Hello, my router address was changed dynamically by my provider. Every time in such cases fail2ban blocks my server access completely (Cockpit, Mail, SSH). I can whitelist my new IP only by accessing the server from my cell phone.
How can I prevent such misbehavior?
Same at my house, only dynamic IP, could you please search why you are blocked, It is really rare that fail2ban blocks for a bad reason, please check log.
Alternatively I use the incremental ban time with a short time (One minute), if you make a mistake you have just to wait a short time, if you are an attacker, the time is X2 after each bad attempt.
Nevertheless, check fail2ban log and add a regex rule to not catch your application like I did for nextcloud if it is the case
Feb 7 06:58:26 ns-srv01 postfix/smtpd[10161]: connect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 06:58:26 ns-srv01 postfix/smtpd[10161]: NOQUEUE: reject: RCPT from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]: 450 4.1.8 root@lan.home: Sender address rejected: Domain not found; from=root@lan.home to=<admin@[MY-DOMAIN].de> proto=ESMTP helo=<nethserver.lan.home>
Feb 7 06:58:26 ns-srv01 postfix/smtpd[10161]: disconnect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 06:58:26 ns-srv01 rspamd[2749]: ; milter; rspamd_milter_process_command: got connection from 93.###.##.##:40278
Feb 7 07:08:26 ns-srv01 postfix/smtpd[13269]: connect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 07:08:26 ns-srv01 postfix/smtpd[13269]: NOQUEUE: reject: RCPT from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]: 450 4.1.8 root@lan.home: Sender address rejected: Domain not found; from=root@lan.home to=<admin@[MY-DOMAIN].de> proto=ESMTP helo=<nethserver.lan.home>
Feb 7 07:08:26 ns-srv01 postfix/smtpd[13269]: disconnect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 07:08:26 ns-srv01 rspamd[2749]: <61cde8>; milter; rspamd_milter_process_command: got connection from 93.###.##.##:40834
Feb 7 07:13:22 ns-srv01 postfix/anvil[13271]: statistics: max connection rate 1/60s for (smtp:93.###.##.##) at Feb 7 07:08:26
Feb 7 07:13:22 ns-srv01 postfix/anvil[13271]: statistics: max connection count 1 for (smtp:93.###.##.##) at Feb 7 07:08:26
Feb 7 07:13:26 ns-srv01 postfix/smtpd[14323]: connect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 07:13:26 ns-srv01 postfix/smtpd[14323]: NOQUEUE: reject: RCPT from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]: 450 4.1.8 root@lan.home: Sender address rejected: Domain not found; from=root@lan.home to=<admin@[MY-DOMAIN].de> proto=ESMTP helo=<nethserver.lan.home>
Feb 7 07:13:26 ns-srv01 postfix/smtpd[14323]: disconnect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 07:13:26 ns-srv01 rspamd[2749]: ; milter; rspamd_milter_process_command: got connection from 93.###.##.##:41086
Feb 7 07:23:22 ns-srv01 postfix/anvil[14325]: statistics: max connection rate 1/60s for (smtp:93.###.##.##) at Feb 7 07:13:26
Feb 7 07:23:22 ns-srv01 postfix/anvil[14325]: statistics: max connection count 1 for (smtp:93.###.##.##) at Feb 7 07:13:26
Feb 7 07:48:26 ns-srv01 postfix/smtpd[22126]: connect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 07:48:26 ns-srv01 postfix/smtpd[22126]: NOQUEUE: reject: RCPT from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]: 450 4.1.8 root@lan.home: Sender address rejected: Domain not found; from=root@lan.home to=<admin@[MY-DOMAIN].de> proto=ESMTP helo=<nethserver.lan.home>
Feb 7 07:48:26 ns-srv01 postfix/smtpd[22126]: disconnect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 07:48:26 ns-srv01 rspamd[2749]: <38c371>; milter; rspamd_milter_process_command: got connection from 93.###.##.##:42966
Feb 7 07:53:22 ns-srv01 postfix/anvil[22128]: statistics: max connection rate 1/60s for (smtp:93.###.##.##) at Feb 7 07:48:26
Feb 7 07:53:22 ns-srv01 postfix/anvil[22128]: statistics: max connection count 1 for (smtp:93.###.##.##) at Feb 7 07:48:26
Feb 7 08:08:26 ns-srv01 postfix/smtpd[26107]: connect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 08:08:27 ns-srv01 postfix/smtpd[26107]: NOQUEUE: reject: RCPT from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]: 450 4.1.8 root@lan.home: Sender address rejected: Domain not found; from=root@lan.home to=<admin@[MY-DOMAIN].de> proto=ESMTP helo=<nethserver.lan.home>
Feb 7 08:08:27 ns-srv01 postfix/smtpd[26107]: disconnect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 08:08:27 ns-srv01 rspamd[2749]: <633a17>; milter; rspamd_milter_process_command: got connection from 93.###.##.##:44452
Feb 7 08:18:26 ns-srv01 postfix/smtpd[29598]: connect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 08:18:26 ns-srv01 postfix/smtpd[29598]: NOQUEUE: reject: RCPT from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]: 450 4.1.8 root@lan.home: Sender address rejected: Domain not found; from=root@lan.home to=<admin@[MY-DOMAIN].de> proto=ESMTP helo=<nethserver.lan.home>
Feb 7 08:18:26 ns-srv01 postfix/smtpd[29598]: disconnect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 08:18:26 ns-srv01 rspamd[2749]: <90a87b>; milter; rspamd_milter_process_command: got connection from 93.###.##.##:45148
Feb 7 08:23:26 ns-srv01 postfix/smtpd[30750]: connect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 08:23:26 ns-srv01 postfix/smtpd[30750]: NOQUEUE: reject: RCPT from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]: 450 4.1.8 root@lan.home: Sender address rejected: Domain not found; from=root@lan.home to=<admin@[MY-DOMAIN].de> proto=ESMTP helo=<nethserver.lan.home>
Feb 7 08:23:26 ns-srv01 postfix/smtpd[30750]: disconnect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 08:23:26 ns-srv01 rspamd[2749]: <09fab6>; milter; rspamd_milter_process_command: got connection from 93.###.##.##:45524
Feb 7 08:28:22 ns-srv01 postfix/anvil[29600]: statistics: max connection rate 1/60s for (smtp:93.###.##.##) at Feb 7 08:18:26
Feb 7 08:28:22 ns-srv01 postfix/anvil[29600]: statistics: max connection count 1 for (smtp:93.###.##.##) at Feb 7 08:18:26
Feb 7 10:26:26 ns-srv01 postfix/smtpd[16544]: connect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 10:26:26 ns-srv01 postfix/smtpd[16544]: 86ADB805CD20: client=[MY-ID].dip0.t-ipconnect.de[93.###.##.##], sasl_method=PLAIN, sasl_username=marko@[MY-DOMAIN].de
Feb 7 10:26:26 ns-srv01 rspamd[2759]: <3a5a04>; milter; rspamd_milter_process_command: got connection from 93.###.##.##:53405
Feb 7 10:26:27 ns-srv01 rspamd[2759]: <3a5a04>; proxy; rspamd_task_write_log: id: <5BBE2462-29A7-4DA3-A81E-CEF15A0E806A@[MY-DOMAIN].de>, qid: <86ADB805CD20>, ip: 93.###.##.##, user: marko@[MY-DOMAIN].de, from: <marko@[MY-DOMAIN].de>, (default: F (no action): [-3.69/20.00] [BAYES_HAM(-2.99){99.99%;},SIGNED_PGP(-2.00){},URL_IN_SUBJECT(1.00){nextcloud.[MY-DOMAIN].de;},MV_CASE(0.50){},MIME_GOOD(-0.20){multipart/signed;multipart/alternative;text/plain;multipart/related;},ASN(0.00){asn:3320, ipnet:93.192.0.0/10, country:DE;},FROM_EQ_ENVFROM(0.00){},FROM_HAS_DN(0.00){},HAS_ATTACHMENT(0.00){},MID_RHS_MATCH_FROM(0.00){},MIME_TRACE(0.00){0:+;1:+;2:+;3:+;4:~;5:~;6:~;},RCPT_COUNT_ONE(0.00){1;},RCVD_COUNT_ZERO(0.00){0;},TO_DN_ALL(0.00){},TO_MATCH_ENVRCPT_ALL(0.00){}]), len: 244817, time: 882.743ms, dns req: 16, digest: <9a66e0feae79754f53efe5ef53d59d38>, rcpts: name@anybody.de, mime_rcpts: name@anybody.de, settings_id: authenticated
Feb 7 10:27:27 ns-srv01 postfix/smtpd[16544]: disconnect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 10:28:26 ns-srv01 postfix/smtpd[17144]: connect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 08:40:02 ns-srv01 postfix/smtpd[1187]: lost connection after CONNECT from engine25.uptimerobot.com[63.143.42.250]
| Feb 7 08:44:35 ns-srv01 postfix/smtpd[2209]: lost connection after CONNECT from engine25.uptimerobot.com[63.143.42.250]
| Feb 7 08:45:02 ns-srv01 postfix/smtpd[2300]: lost connection after CONNECT from engine25.uptimerobot.com[63.143.42.250]
| Feb 7 08:49:35 ns-srv01 postfix/smtpd[3204]: lost connection after CONNECT from engine25.uptimerobot.com[63.143.42.250]
| Feb 7 08:50:02 ns-srv01 postfix/smtpd[3305]: lost connection after CONNECT from engine25.uptimerobot.com[63.143.42.250]
| Feb 7 08:54:35 ns-srv01 postfix/smtpd[4308]: lost connection after CONNECT from engine25.uptimerobot.com[63.143.42.250]
| Feb 7 08:55:02 ns-srv01 postfix/smtpd[4371]: lost connection after CONNECT from engine25.uptimerobot.com[63.143.42.250]
| Feb 7 08:59:35 ns-srv01 postfix/smtpd[4965]: lost connection after CONNECT from engine25.uptimerobot.com[63.143.42.250]
[root@ns-srv01 log]# cat maillog | grep 07:13
Feb 7 07:13:22 ns-srv01 postfix/anvil[13271]: statistics: max connection rate 1/60s for (smtp:93.###.##.##) at Feb 7 07:08:26
Feb 7 07:13:22 ns-srv01 postfix/anvil[13271]: statistics: max connection count 1 for (smtp:93.###.##.##) at Feb 7 07:08:26
Feb 7 07:13:22 ns-srv01 postfix/anvil[13271]: statistics: max cache size 1 at Feb 7 07:08:26
Feb 7 07:13:26 ns-srv01 postfix/smtpd[14323]: connect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 07:13:26 ns-srv01 rspamd[2749]: <ac7cea>; proxy; proxy_accept_socket: accepted milter connection from /var/run/rspamd/worker-proxy port 0
Feb 7 07:13:26 ns-srv01 postfix/smtpd[14323]: NOQUEUE: reject: RCPT from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]: 450 4.1.8 <root@lan.home>: Sender address rejected: Domain not found; from=<root@lan.home> to=<admin@[MYDOMAIN].de> proto=ESMTP helo=<nethserver.lan.home>
Feb 7 07:13:26 ns-srv01 postfix/smtpd[14323]: disconnect from [MY-ID].dip0.t-ipconnect.de[93.###.##.##]
Feb 7 07:13:26 ns-srv01 rspamd[2749]: <ac7cea>; milter; rspamd_milter_process_command: got connection from 93.###.##.##:41086
Feb 7 07:13:26 ns-srv01 rspamd[2749]: <ac7cea>; proxy; proxy_milter_finish_handler: finished milter connection
Feb 7 07:13:27 ns-srv01 rspamd[2753]: <id8dcm>; lua; bayes_expiry.lua:440: finished expiry step 48: 996 items checked, 214 significant (4 made persistent), 0 insignificant (0 ttls set), 1 common (0 discriminated), 781 infrequent (0 ttls set), 20 mean, 47 std
Feb 7 07:23:22 ns-srv01 postfix/anvil[14325]: statistics: max connection rate 1/60s for (smtp:93.###.##.##) at Feb 7 07:13:26
Feb 7 07:23:22 ns-srv01 postfix/anvil[14325]: statistics: max connection count 1 for (smtp:93.###.##.##) at Feb 7 07:13:26
Feb 7 07:23:22 ns-srv01 postfix/anvil[14325]: statistics: max cache size 1 at Feb 7 07:13:26
[root@ns-srv01 log]#