Block an IP address or an IP range with Iptables

1. Block an IP address or an IP range with Iptables

To block a hacker, you need to block its IP address in the firewall on your Linux server.
For this, we will use iptables to block incoming traffic from the IP address “xx.xx.xx.xx” (where xx.xx.xx.xx is the IP address of the hacker).

Code : Bash

1
iptables -I INPUT -s xx.xx.xx.xx -j DROP

If the hacker uses an IP range (for example : 10.0.0.10, 10.0.0.11, 10.0.0.12, … 10.0.0.20), simply use this command :

Code : Bash

1
iptables -I INPUT -m iprange --src-range 10.0.0.10-10.0.0.20 -j DROP

If you want to block the outgoing connection (your server => other servers) to an IP range, use the “–dst-range” parameter instead of the “–src-range” parameter.
Thus, your server will no longer be able to send data to this IP range.

Code : Bash

1
iptables -I INPUT -m iprange --dst-range 10.0.0.10-10.0.0.20 -j DROP

 

Continue reading

windows cannot be installed on this disk. The selected disk is of the GPT partition style

Trying to swap a hard drive from my mac to an HP laptop, got stuck with an MBR error, so after trying all the above with no success once or ever, I found this solution:
***Be mindful to backup your files prior to trying this. Use an external case and save everything into another hard drive***
Method #1:
1. Boot up to installation DVD/CD.
2. Click install but don’t follow through.
3. Press SHIFT-F10 to bring up console.