How to block certain IP address to access certain domain/IP in Linux ?
I have CentOS installed on my server for virtual server purposes. I have a few virtual servers clients each one with his own IP. I need to block their IP to access certain domain.
I know this iptables rules totally blocks access to certain IP but I only need to limit the access only to a few clients, so this one block total access :
iptables -A OUTPUT -d 123.123.123.123 -j DROP
I need one rule that will mention what IP would be blocked from access 123.123.123.123
iptables -A OUTPUT -s 10.1.1.0/28 -d 192.168.3.3 -j DROP
?DROP
ped with-s
, the required destination address/block with-d
. Blocking destination domains can't be done reliably iniptables
, as a very small amount of searching on SF would have told you (eg, this one or this one ).order allow,deny
andallow from all
deny from 123.123.123.123
. Other webserver has similar ways to block ip from accessing a website without having to fiddle with low-level tool. The advantage is that you can prevent access to a single website on a shared host.