@Johann150
fail2ban can handle this:
https://askubuntu.com/questions/1184480/fail2ban-dynamic-ip/1184495#1184495

port knocking is another option, that I use sometimes

Fail2ban Dynamic IP

I need help setting up my Fail2ban. I have a client that your IP is Dynamic. and every time I need to wait for it to tell me the IP so I can include ignoreip. How can i make a script to collect i...