As sip.conf gets parsed, it defines the [general] context, then loads the following conf files in order:Does the alwaysauthreject=yes need to go in sip_custom.conf or sip_general_custom.conf in freePBX? Does it matter?
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9907"<sip:9907@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9908"<sip:9908@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9909"<sip:9909@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9910"<sip:9910@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9911"<sip:9911@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9912"<sip:9912@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9913"<sip:9913@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9914"<sip:9914@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9915"<sip:9915@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9916"<sip:9916@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9917"<sip:9917@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9918"<sip:9918@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9919"<sip:9919@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
[Jun 5 04:50:43] NOTICE[2577] chan_sip.c: Registration from '"9920"<sip:9920@my-pbx-ip-address>' failed for '216.245.200.107' - No matching peer found
What would you think about rate-limiting some of the SIP traffic allowed per IP?Still not convinced there's not a better way to block these creeps. Could you post just a snippet of the Asterisk log showing these attempts. Rather than waiting to read the log, perhaps we need something to watch the Asterisk CLI. That would be almost instantaneous.
-A INPUT -p udp -m hashlimit --dport 5060 --hashlimit 500/sec --hashlimit-mode srcip,dstport --hashlimit-name siphash -j ACCEPT
We're talking per IP address, correct? And 5060 only carries the call setup. RTP packets handle the call itself.That should be roughly 1 packet per registration attempt. 5 might be shaving it a bit too thin. I'm thinking you'd eat up at least that many packets from an outside extension, no?That looks like roughly 100 attempts per second from one IP address. Anybody know how many sip packets that would be? 100? If it's 1-for-1, then I would think a number more like 5 in IPtables might suffice.We're talking per IP address, correct? And 5060 only carries the call setup. RTP packets handle the call itself.
I'm thinking this will give fail2ban more time to work. I agree with you though, fail2ban should be inserting a block rule within a second or two of seeing the event in the log. Nothing should be able to go on for minutes if things are configured & working properly.This approach wouldn't ban the creeps, just slow them down to a crawl. My guess is that with that much traffic, the server process to check the logs was completely shut down.
Link up your team and customers Phone System
Live Chat
Video Conferencing
Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.
Check your inbox!
We’ve sent you an email. Click on the button in the email body to verify your email address – (if you can not find it, check your spam folder).
Upon verification you will be directed to the 3CX setup wizard.