LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 04-22-2014, 09:55 AM   #1
Nagendrakoduru
LQ Newbie
 
Registered: Apr 2014
Location: Hyderabad
Posts: 1

Rep: Reputation: Disabled
Using iptables to block websites by IP


Hello World,
How to block particular websites for some ipaddresses
and i want to give full acces to 5 ips by using iptables in linux..

Last edited by Nagendrakoduru; 04-22-2014 at 09:57 AM.
 
Old 04-22-2014, 10:21 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Nagendrakoduru View Post
Hello World,
How to block particular websites for some ipaddresses and i want to give full acces to 5 ips by using iptables in linux..
Please read the LQ Rules, and read the "How to ask a smart question" guidelines. Subjects of "Help Me", dont' tell ANYONE, ANYTHING about your issue, and don't get answered very quickly.

If you want to block websites, you need a proxy server like Squid. There is abundant documentation on how to install/configure it for pretty much every distro of Linux.
 
Old 04-23-2014, 02:54 AM   #3
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 509

Rep: Reputation: 203Reputation: 203Reputation: 203
Hi,

You could do this with iptables. For us to try and assist with this we would need some additional info, though. What does your network look like - is internet access via a Linux gateway already? If so, what distro, and what firewall rules do you currently have in place?

I second TB0ne's suggestion, though: squid is much better suited to the job of controlling access to specific sites and/or for specific users (either by IP or by username). You might also want to look at squidGuard.

Regards,

Clifford

---------- Post added 2014-04-23 at 09:54 ----------

Hi,

You could do this with iptables. For us to try and assist with this we would need some additional info, though. What does your network look like - is internet access via a Linux gateway already? If so, what distro, and what firewall rules do you currently have in place?

I second TB0ne's suggestion, though: squid is much better suited to the job of controlling access to specific sites and/or for specific users (either by IP or by username). You might also want to look at squidGuard.

Regards,

Clifford
 
1 members found this post helpful.
Old 04-24-2014, 03:49 AM   #4
beqsbeqs7171
LQ Newbie
 
Registered: Apr 2014
Posts: 1

Rep: Reputation: Disabled
Hi,

I installed in VMware three OS: Windows server 2008 r2, centos and windows 7. I created Active Directory and this windows 7 has joined into domain, then I configured in Centos squid proxy server,which blocks domain's user's all sites in browser except 2 sites and it works good... but domain's user's can't connect with Remote Desktop to other network... what should I do in Linux, what must it be configured? can anyone help me?
 
Old 04-24-2014, 09:13 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by beqsbeqs7171 View Post
Hi,

I installed in VMware three OS: Windows server 2008 r2, centos and windows 7. I created Active Directory and this windows 7 has joined into domain, then I configured in Centos squid proxy server,which blocks domain's user's all sites in browser except 2 sites and it works good... but domain's user's can't connect with Remote Desktop to other network... what should I do in Linux, what must it be configured? can anyone help me?
You first need to read the LQ Rules, and open your own thread for your own question.

Secondly, you need to realize that squid is an HTTP proxy...it DOES NOT do anything with other protocols, RDP included. If you want RDP to another network, you need to allow that traffic through your firewall. Squid doesn't enter into it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to block ALL websites except 2 glenn69 Linux - Networking 8 12-12-2019 12:56 PM
How to block websites? cusri2004 Linux - Newbie 1 12-26-2010 10:07 PM
squid 2.5 how to block websites tarak420 Linux - Networking 1 08-01-2009 06:50 AM
using iptables how do i block file listing of websites? murphydims Linux - Security 4 04-26-2006 11:49 AM
how to block websites .. huno Linux - Software 5 04-22-2004 08:31 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 12:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration