I have this one particular IP range that keeps attempting to connect to my VPN through IPsec on my L2TP server. My secrets and passwords are very strong so no worries there but was curious if someone might know of a way to put in a firewall rule or something that would just drop all traffic from them all together? I tried several firewall settings but nothing seems to work.
Check how the firewall filter actually works.
Of course you can ban the annoying addresses completely like @HzMeister suggests, but you can also ban them selectively only for UDP destination ports 500 and 4500 through which the IPsec connections come in. You can also log packets coming from these addresses to find out which other services it is attempting to connect to. The internet is full of “white hat” and “black hat” scanners - check for ****
shadowserver
and
shodan.io
.
I have the following semi-automatic address recorder in action:
Thank you HzMeister. That worked but I will look in to sindy’s idea as well as I like that option because it gives me something to try and learn. Thanks!!
To expand on HzMeister’s firewall example, here is part of my standard firewall rules addressing unsolicited incoming traffic. What I like about this set of rules is I can apply it to any protocols and port(s) that I wish. I found the basic example for blacklisting some time ago I believe on the MT forums, wiki or somewhere and expanded on it somewhat.
In this example, after checking the whitelist (whitelist.mgmt), any new connection attempt received on ether1 is processed through and will end up in the blacklist after a certain number of connection attempts within a certain time window. The jump rule can be more specific, such as for specific protocols and ports. It can also be used for traffic in the forward chain in case you are exposing an internal host service to the internet, such as a web server or FTP simply by adding a matching jump rule.