[x] Welcome to LinuxSolved.com Linux help forums, here we are a community of Linux users helping each other. It is helpful to both ie. new linux users as well experienced one. We always have our experts to help you and ofcourse members help each other, so you can ask for help any time by Registering.: Click to Register

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Linux Forums - Linux Help,Advice & support community:LinuxSolved.com  |  Forum  |  Network Troublshooting  |  General Networking Support in Linux  |  Topic: blocking websites
Welcome to LinuxCommunity

You have just arrived to a friendly linux community which is helping Linux Users from Years.. You can be its part if you have not already joined it. Registration is FREE and is gateway to unlimited help and support to all your linux related needs. If you are an GNU/Linux supporter then you have come to the right place.
Pages: [1]
  Print  
Author Topic: blocking websites  (Read 7954 times)
0 Members and 1 Guest are viewing this topic.
sathish
Linux Learner
***
Offline Offline

Posts: 73


View Profile
« on: December 12, 2003, 10:51:13 PM »

Hello,

I am using RedHat 9.0, We are having 50 clients in the office.  I have done masquerade to share the net from Linux server to windows clients.

I want to block all websites except 2 to 3 websites we use.

Ex : google.com, altavista.com and alltheweb.com.

In the clients  side. I want to access only the above said websites. And remaining all websites to be blocked.  Is it possible.. If yes,  please give me the steps to be followed.  :?:
Thank you,
Sathish.
Logged
Ricky
LST CareTaker
Specially Skilled
*****
Offline Offline

Gender: Male
Posts: 2377


View Profile
« Reply #1 on: December 13, 2003, 01:30:05 AM »

It depends upon wht are u currently using ??

If you are using squid then you can easily block them !! also iptables can be used !! so wht are u using rt now ?
Logged
sathish
Linux Learner
***
Offline Offline

Posts: 73


View Profile
« Reply #2 on: December 15, 2003, 03:12:10 AM »

Hi Ricky,

We are using for searching for a Medicines names. As we are related for a Medical company. I want to block through iptables.
Logged
LS-Admin
Administrator
Linux Learner
*****
Offline Offline

Gender: Male
Posts: 67


View Profile
« Reply #3 on: December 15, 2003, 10:27:19 AM »

Go for squid .. it is better for this type of jobs..  or filtering..
Logged
Ricky
LST CareTaker
Specially Skilled
*****
Offline Offline

Gender: Male
Posts: 2377


View Profile
« Reply #4 on: December 15, 2003, 10:32:59 AM »

Well i can tell you how to block a specific site..
Code:
iptables -A FORWARD -d domain.com -j DROP
Logged
marcus01
New Member

Offline Offline

Posts: 3


View Profile
« Reply #5 on: September 05, 2004, 08:34:50 PM »

Hi Guy's

i got the same promblem i really want to block all the sites and accepts only the others that i like!

can please someone here help me?Huh im using iptables coz im having problem on configurong squid! Cheesy thanks in advance!
Logged
marcus01
New Member

Offline Offline

Posts: 3


View Profile
« Reply #6 on: September 06, 2004, 12:19:01 AM »

i created a script the will call a txt file contains the ip address of the site that i only want to access. but im getting some some problems like

1. when i access some site it gaves me 403 error but some of it i can accesss!
2. i can only type ip address to access the site if i type the url of the site i cant access is!

can please some one help me on this???

here is the script that i made:

#!/bin/sh

# Disable forwarding
echo 0 > /proc/sys/net/ipv4/ip_forward

GOODIP=/etc/rc.d/goodlist.txt
LAN_IP_NET='192.168.1.0/24'
LAN_NIC='eth1'
WAN_IP='xxx.xxx.xxx.xxx'
WAN_NIC='eth0'

# Flush
iptables -t nat -F POSTROUTING
iptables -t nat -F PREROUTING
iptables -t nat -F OUTPUT
iptables -F

iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

iptables -A INPUT -s 0/0 -d 0/0 -j ACCEPT
iptables -A OUTPUT -s 0/0 -d 0/0 -j ACCEPT
iptables -A FORWARD -s 0/0 -d 0/0 -j ACCEPT

# enable Masquerade and forwarding
iptables -t nat -A POSTROUTING -s $LAN_IP_NET -j MASQUERADE
iptables -t nat -A POSTROUTING -s $WAN_IP -j MASQUERADE
iptables -A FORWARD -j ACCEPT -i $LAN_NIC -s $LAN_IP_NET
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT


echo "Blocking all unwanted IP's                              [ OK ]"

iptables -I FORWARD -s 0/0 -d 0/0 -j DROP

iptables -I FORWARD -p udp -s 0/0 -d 0/0 --dport 53 -j ACCEPT
iptables -I FORWARD -p tcp -s 0/0 -d 0/0 --dport 80 -j ACCEPT
iptables -I FORWARD -p tcp -s 0/0 -d 0/0 --dport 22 -j ACCEPT
iptables -I FORWARD -p tcp -s 0/0 -d 0/0 --dprot 25 -j ACCEPT
iptables -I FORWARD -p tcp -s 0/0 -d 0/0 --dport 20 -j ACCEPT
iptables -I FORWARD -p tcp -s 0/0 -d 0/0 --dport 21 -j ACCEPT


echo "Allowing Good IP's                                      [ OK ]"

for x in `grep -v ^# $GOODIP | awk '{print $1}'`; do

echo "Permitting $x             [ OK ]"

iptables -I FORWARD -s $x -j ACCEPT
done

# STATE RELATED for router
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Enable forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
Logged
salvesatish
New Member

Offline Offline

Posts: 2


View Profile
« Reply #7 on: December 11, 2004, 05:54:41 AM »

Have you checked SafeSquid?

SafeSquid is Contenet filtering Internet Proxy.
SafeSquid helps you to achieve more productivity.

I am just mentioning few features of SafeSquid.

*STOP Getting lured by fraudulent web-links to visit pornographic sites,
*BLOCK Advertisement pop-ups that drive you crazy,
*PREVENT Employees wasting business-hours and resources on needless downloads,
*PREVENT Computers getting infected with viruses / Trojan by a visit to innocent looking web-sites

You can visit the site www.safesquid.com & also their support forum at www.safesquid.com/forum
Logged
Pages: [1]
  Print  
 
Jump to:  

Search LS
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 09, 2010, 11:01:02 AM

Login with username, password and session length
Navigation
Recent Discussions
[September 06, 2010, 03:51:09 PM]

[September 06, 2010, 07:59:34 AM]

[September 03, 2010, 11:45:53 AM]

[September 02, 2010, 06:21:15 AM]

[September 02, 2010, 03:14:25 AM]

[August 31, 2010, 08:30:56 AM]

[August 31, 2010, 01:03:31 AM]

[August 31, 2010, 12:53:38 AM]

[August 31, 2010, 12:43:01 AM]

[August 22, 2010, 05:55:23 AM]
Members
Total Members: 7757
Latest: vikas1980
Stats
Total Posts: 9561
Total Topics: 2751
Online Today: 12
Online Ever: 128
(April 10, 2010, 10:24:17 PM)
Users Online
Users: 0
Guests: 12
Total: 12
Privacy Policy| Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Theme & TinyPortal v0.9.8 © Bloc