Cannot Connect From Certain IP

From Kolmisoft Wiki
Revision as of 10:25, 4 February 2020 by Edvardas (talk | contribs) (Created page with ''''Check if IP blocked or not at this moment by iptables:''' #iptables -L -n | grep 192.168.11.125<br> '' REJECT all -- 192.168.11.125 0.0.0.0/0 reject…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Check if IP blocked or not at this moment by iptables:

#iptables -L -n | grep 192.168.11.125
REJECT all -- 192.168.11.125 0.0.0.0/0 reject-with icmp-port-unreachable

Check Fail2ban log for blocked IP:

#grep -F "192.168.11.125" /var/log/fail2ban.log
2020-02-04 08:41:12,175 fail2ban.filter [1788]: INFO [asterisk-iptables] Found 192.168.11.125 2020-02-04 08:41:13,131 fail2ban.actions [1788]: NOTICE [asterisk-iptables] Ban 192.168.11.125 2020-02-04 08:51:13,973 fail2ban.actions [1788]: NOTICE [asterisk-iptables] Unban 192.168.11.125 2020-02-04 08:51:28,470 fail2ban.filter [1788]: INFO [asterisk-iptables] Found 192.168.11.125 2020-02-04 08:53:28,767 fail2ban.filter [1788]: INFO [asterisk-iptables] Found 192.168.11.125 2020-02-04 08:55:29,018 fail2ban.filter [1788]: INFO [asterisk-iptables] Found 192.168.11.125 2020-02-04 08:57:29,433 fail2ban.filter [1788]: INFO [asterisk-iptables] Found 192.168.11.125 2020-02-04 08:59:28,785 fail2ban.filter [1788]: INFO [asterisk-iptables] Found 192.168.11.125 2020-02-04 08:59:29,689 fail2ban.actions [1788]: NOTICE [asterisk-iptables] Ban 192.168.11.125

To check Asterisk log by IP:

#grep -F "192.168.11.125" /var/log/asterisk/messages
[2020-02-04 08:53:28] NOTICE[2451] chan_sip.c: Registration from '<sip:123456@192.168.11.120>' failed for '192.168.11.125:62219' - Wrong password [2020-02-04 08:55:28] NOTICE[2451] chan_sip.c: Registration from '<sip:123456@192.168.11.120>' failed for '192.168.11.125:62219' - Wrong password [2020-02-04 08:57:28] NOTICE[2451] chan_sip.c: Registration from '<sip:123456@192.168.11.120>' failed for '192.168.11.125:62219' - Wrong password [2020-02-04 08:59:28] NOTICE[2451] chan_sip.c: Registration from '<sip:123456@192.168.11.120>' failed for '192.168.11.125:62219' - Wrong password