LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-20-2010, 05:17 AM   #1
ashishkhandelwal
Member
 
Registered: Jan 2010
Posts: 34

Rep: Reputation: 15
Squid server internet access problem


I have configured squid server and it is working fine.I want that only specific ip addresses in my LAN should be able to access internet and for that i have given these entries in access control lists in squid.conf file:

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl CONNECT method CONNECT
acl QUERY urlpath_regex cgi-bin \?
acl apache rep_header Server ^Apache
acl our_networks src 192.168.0.181/255.255.255.0 192.168.0.182/255.255.255.0

and in http access i have given this

http_access allow our_networks
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all

In this i want that only 192.168.0.181 and .182 should be able to access internet but Now the problem is that all the IPs in the LAN like 192.168.0.20 are also able to access internet.What changes i need to do to allow access to specific IP addresses.I am not using any firewall or iptables entries and i am manually changing in the firefox at client side to access internet.
 
Old 02-20-2010, 05:49 AM   #2
devwatchdog
Member
 
Registered: Jan 2010
Posts: 202

Rep: Reputation: 47
I'm guessing when you define:

acl our_networks src 192.168.0.181/255.255.255.0 192.168.0.182/255.255.255.0

squid is interpreting 192.168.0.181/255.255.255.0 as a network, because that is what this definition is.

Code:
jcwx@haley:~$ ipcalc 192.168.0.181/255.255.255.0
Address:   192.168.0.181        11000000.10101000.00000000. 10110101
Netmask:   255.255.255.0 = 24   11111111.11111111.11111111. 00000000
Wildcard:  0.0.0.255            00000000.00000000.00000000. 11111111
=>
Network:   192.168.0.0/24       11000000.10101000.00000000. 00000000
HostMin:   192.168.0.1          11000000.10101000.00000000. 00000001
HostMax:   192.168.0.254        11000000.10101000.00000000. 11111110
Broadcast: 192.168.0.255        11000000.10101000.00000000. 11111111
Hosts/Net: 254                   Class C, Private Internet
If it were only one host, 192.168.0.181/255.255.255.255 would define it as such.

Drop the netmask for single host definitions and see if that works. I haven't worked on squid in a few years, but as I recall, you don't need a netmask for single hosts.

acl our_networks src 192.168.0.181 192.168.0.182
 
Old 02-20-2010, 07:38 AM   #3
ashishkhandelwal
Member
 
Registered: Jan 2010
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks a lot...It worked for me.Now i will be very much grateful if any one can tell me how to use squid server with iptables.Right now i have to manually configure web browser at each client side to use squid as proxy server but i want that i dont have to change anything in client's web browser and it should automatically start.I think it can be done by using iptables but i dont know how to do it.
 
Old 02-20-2010, 08:13 AM   #4
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
Quote:
Originally Posted by ashishkhandelwal View Post
Thanks a lot...It worked for me.Now i will be very much grateful if any one can tell me how to use squid server with iptables.Right now i have to manually configure web browser at each client side to use squid as proxy server but i want that i dont have to change anything in client's web browser and it should automatically start.I think it can be done by using iptables but i dont know how to do it.
That's Transparent proxying, which you can achieve with iptables and port forwarding. Google on that, there are a lot of docs about it.
 
  


Reply

Tags
access, squid



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
Squid server not giving access to my local machine to internet ashish1983 Linux - Newbie 3 05-14-2009 12:15 AM
how to access internet on linux clients By our Squid Proxy server farrukhndm Linux - Server 2 03-07-2009 06:22 AM
domain user authentication for squid proxy server for internet access manabJyoti Linux - General 1 05-10-2008 09:08 AM
download restriction over internet access using squid (proxy server) pankajkarde Linux - Server 4 03-21-2007 01:04 AM
config squid so some IP can access internet, and others just the server? 4mix Linux - Networking 5 07-20-2004 05:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:28 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