Blog

YOU ARE NOW IN :: HOME :: BLOG

How to unblock your IP?

By Ah Hock - March 17th 2014 17:50 PM GMT+0800

Assuming you have subscribed to a dedicated server or Cloud VPS server running Linux and apf-bfd, the below tips can come handy when you experienced locked out of your own box.

Another assumption is that you allow SSH access to your server, and you use APF-BFD to restrict access and protect yourself from brute force attacks. APF-BFD stands for Advanced Policy Firewall coupled with Brute Force Detection,

Command to check if your IP is block.
Say if your IP is 121.242.90.50

Log into server via SSH as root via another computer with a different IP.

Put the command below to check if your IP is being blocked.

iptables -L -n | grep 121.242.90.50

If the below result shows, it means your IP is being blocked.

DROP all -- 121.242.90.50 0.0.0.0/0
DROP all -- 0.0.0.0/0 121.242.90.50

Now let us unblock your IP.
Assuming that you are using APF, please run the below command.
apf --remove 121.242.90.50

If the below result shows, it means your IP is being unblocked.
apf(22011): {trust} removed 121.242.90.50 from trust system

Then, restart apf using command below:
apf -r

The below result will shows.
apf(22211): {glob} flushing & zeroing chain policies
apf(22211): {glob} firewall offline
apf(22246): {glob} activating firewall
apf(22286): {glob} unable to load iptables module (ip_tables), aborting.
apf(22246): {glob} firewall initalized

Give this command to whitelist your IP
apf -a 121.242.90.50

- END -


MOST READ