The source address is not authenticated with UDP. If you add IPs to a block list based solely on a UDP packet, then you risk your network breaking horribly when someone spoofs a bunch of popular IPs such as DNS servers, Google, Facebook, etc.
It seems they connect from a range of Ipaddresses like 1.2.3.X so I’ve added a rule to drop all connections on UDP ports 500 and 4500 from 1.2.3.0/24
Also added a Knock on door rule. It works like this; When you connect on the publicIP on a specific port e.g. 12345. Your IP is added to an address list for 10 seconds. If you connect again on port 54321 within does 10 seconds and your ip is on list 1, you’ll be added to list 2. Only list 2 is allowed to connect to ports 500 and 4500.
your welcome! If you want to, you can use layer 7 to include some sort of password. If your on a Mac or other Linux based OS you can send a “Knock on door”, with the following command
Pretty blunt code just to drop anything trying to come in on those ports. I can see 9 blocked packets in the last few minutes and no more nasty red ipsec logs
I’ve been annoyed by this very issue for quite a while.
Recently I decided to make
/ip firewall filter add action=passthrough chain=input protocol=udp dst-port=500 log=yes
rule (next to accept established ofc) to investigate.
Apparently, those pesky IKE requests come in low packet size, usually below 400 bytes, while valid are 600-1000 bytes.
Based on this observation I now take benefit of the following rule:
/ip firewall filter add action=drop chain=input protocol=udp dst-port=500 packet-size=0-400 place-before=1
Off course, this matching policy isn’t 100% efficient,and moreover, may also block valid connections,but it is what it is.