block a website

Taking care of your Linux box.

block a website

Postby venky145 » Mon Aug 10, 2009 5:41 pm

hi


how can i block a website for a particular ip in iptables only.
venky145
Havaldaar
 
Posts: 118
Joined: Thu Jan 13, 2005 2:35 pm
WLM: ranga72
Yahoo Messenger: venky145
Location: qatar

Re: block a website

Postby LinuxFreaK » Wed Aug 19, 2009 10:45 pm

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
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi

Re: block a website

Postby kbukhari » Wed Aug 19, 2009 11:36 pm

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
kbukhari
Major General
 
Posts: 1222
Joined: Sat Dec 31, 2005 12:29 am
Website: http://kashifbukhari.com
Location: Lahore

block site

Postby venky145 » Sat Aug 22, 2009 12:58 am

hi


i want to block site for particular ip only not for entire pool. and its only in iptables not in suid.
venky145
Havaldaar
 
Posts: 118
Joined: Thu Jan 13, 2005 2:35 pm
WLM: ranga72
Yahoo Messenger: venky145
Location: qatar

Postby lambda » Sat Aug 22, 2009 12:29 pm

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"?
lambda
Major General
 
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Website: http://www.hungry.com/~fn/
Location: Lahore

Re:

Postby LinuxFreaK » Mon Aug 24, 2009 6:06 am

Dear venky145,
Salam,

I agree with both kbukhari and lambda :)

Best Regards.
Farrukh Ahmed
LinuxFreaK
Site Admin
 
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
ICQ: 82075802
Website: http://www.linuxpakistan.net/wiki/index.php?pagename=LinuxFreak
WLM: f4fahmed@hotmail.com
Yahoo Messenger: f4fahmed@yahoo.com
AOL: linuxpakistan@aol.com
Location: Karachi


Return to “%s” Administration

Who is online

Users browsing this forum: No registered users and 0 guests

cron