block a website

Taking care of your Linux box.
Post Reply
venky145
Havaldaar
Posts: 118
Joined: Thu Jan 13, 2005 2:35 pm
Location: qatar
Contact:

block a website

Post by venky145 »

hi


how can i block a website for a particular ip in iptables only.
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re: block a website

Post by LinuxFreaK »

Dear venky145,
Salam,
venky145 wrote:how can i block a website for a particular ip in iptables only.
Below command may help you.

# iptables -A INPUT -p tcp --dport 80 -d www.aol.com -j REJECT

Best Regards.
Farrukh Ahmed
kbukhari
Major General
Posts: 1222
Joined: Sat Dec 31, 2005 12:29 am
Location: Lahore
Contact:

Re: block a website

Post by kbukhari »

LinuxFreaK wrote:Dear venky145,
Salam,
venky145 wrote:how can i block a website for a particular ip in iptables only.
Below command may help you.

# iptables -A INPUT -p tcp --dport 80 -d www.aol.com -j REJECT

Best Regards.
iptables -A OUTPUT -p tcp --dport 80 -d www.aol.com -j REJECT
--
Syed Kashif Ali Bukhari
+92-345-8444420
http://sysadminsline.com
http://kashifbukhari.com
venky145
Havaldaar
Posts: 118
Joined: Thu Jan 13, 2005 2:35 pm
Location: qatar
Contact:

block site

Post by venky145 »

hi


i want to block site for particular ip only not for entire pool. and its only in iptables not in suid.
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

take a few minutes to read iptable's documentation. google for "netfilter howto".

Code: Select all

iptables -A FORWARD -p tcp -s 192.168.0.10 --dport 80 -d www.aol.com -j REJECT
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear venky145,
Salam,

I agree with both kbukhari and lambda :)

Best Regards.
Farrukh Ahmed
Post Reply