Reputation: 116
I have 3 ip ranges on my network, I blocked Facebook access with the command line:
iptables -I FORWARD -m string --algo bm --string "facebook.com" -j DROP
I would like to make an exception to the network range "192.168.0.x"
How can I do that?
Thanks in advance!
Upvotes: 0
Views: 5251
Reputation: 1055
You can simply negate
the source IP address using the !
mark.
iptables -I FORWARD ! -s 192.168.0.0/24 -m string --algo bm --string "facebook.com" -j DROP
Upvotes: 1