Why should I firewall servers?

Advantages of firewall: You can filter outbound traffic. Layer 7 firewalls (IPS) can protect against known application vulnerabilities. You can block a certain IP address range and/or port centrally rather than trying to ensure that there is no service listening on that port on each individual machine or denying access using TCP Wrappers. Firewalls can … Read more

REJECT vs DROP when using iptables

As a general rule, use REJECT when you want the other end to know the port is unreachable’ use DROP for connections to hosts you don’t want people to see. Usually, all rules for connections inside your LAN should use REJECT. For the Internet, With the exception of ident on certain servers, connections from the … Read more

best way to clear all iptables rules

To answer your question succinctly, no: there would not be any “leftover” rules after flushing every table. In the interest of being thorough however, you may want to set the policy for the built-in INPUT and FORWARD chains to ACCEPT, as well: iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT iptables … Read more

How to Unban an IP properly with Fail2Ban

With Fail2Ban before v0.8.8: fail2ban-client get YOURJAILNAMEHERE actionunban IPADDRESSHERE With Fail2Ban v0.8.8 and later: fail2ban-client set YOURJAILNAMEHERE unbanip IPADDRESSHERE The hard part is finding the right jail: Use iptables -L -n to find the rule name… …then use fail2ban-client status | grep “Jail list” | sed -E ‘s/^[^:]+:[ \t]+//’ | sed ‘s/,//g’ to get the … Read more