Firewall and fail2ban in ISPmanager

Firewall

"Navigation board" → "Firewall". The list shows rules created in the panel. Rules added manually to iptables are not shown here.

Firewall rules
Firewall rules
  1. Click "Create rule".
  2. Choose the action (allow or deny), protocol, port and source address.
  3. Click "Create".
New rule
New rule

Example: open MySQL (3306) only for your IP — an allow rule, port 3306, source — your IP. Then a deny rule for port 3306 from any address.

Country blocking

"Country blocking" closes access from IP addresses of the selected countries. First choose the IP database in its settings.

Country blocking
Country blocking

fail2ban: protection against password guessing

"Navigation board" → "Network services". "Fail2ban rules" — which services are protected (SSH, panel, email, FTP). "Fail2ban settings" — how many attempts and for how long to block. Put your IPs in the "never ban" field.

Network services and ports
Network services and ports
Fail2ban settings
Fail2ban settings

Which ports are needed

PortPurpose
1500ISPmanager panel
1501external panel applications (phpMyAdmin, webmail from the panel)
22SSH
80, 443sites
25, 465, 587, 110, 143, 993, 995email
21FTP
53DNS

Do not close 1500 and 22 for all addresses until you have added a rule for your IP. Lost access — open the VPS VNC console in the client area.

Questions and answers
Open the VPS VNC console in the client area and remove the rule with iptables, or contact support.
1500 — the panel, 1501 — external applications (phpMyAdmin from the panel), 22 — SSH.
Add your IP to "Never ban" in the fail2ban settings. If you have no access, use VNC or another IP.