1

Is it possible to block an IP starting with?

For example i want to block ALL IPs that starting with

188.67.

Is there a command or a way for that?

My problem:

I have a game server, and A person keeps accessing into with with a proxy server, all of his IPs are starting with 188.67.

What should I do?

2 Answers 2

2

You can use

sudo iptables -I INPUT -s 188.67/16 -j DROP

which will drop all packets from IP addresses from 188.67.0.0 to 188.67.255.255. If this works and you're happy with it then use

service iptables save 

to write the new configuration to /etc/sysconfig/iptables.

1

Yes it is possible. But keep in mind that you will be blocking lots of other legitimate users who might visit your server from the 188.67 IP.

/sbin/iptables -I INPUT -s 188.67.0.0/16 -p tcp --dport 80 -j DROP

You can change the -p option depending on which protocol your server uses, and --dport for the port number on which the server is listening.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .