Spotlight | Reviews | Current Issue | Academy | Newsletter | Subscribe | Shop |
Departments

Partner Links
Make your own website
WinWeb OnlineOffice
Comparing prices of hardware is worth it.
Price Comparison
What:
Where:
Country:
vacatures Netherlands njobs Linux vacatures
arbeit Deutschland njobs Linux arbeit
work United Kingdom njobs Linux jobs
Lavoro Italia njobs Linux lavoro
Emploi France njobs Linux emploi
trabajo Espana njobs Linux trabajo

user friendly

Admin Magazine

ADMIN Network & Security

Subscribe now and save!

 ADMIN - Explore the new world of system administration! ADMIN is a smart, technical magazine for IT pros on heterogeneous networks. Each issue delivers technical solutions to the real-world problems you face every day. Learn the latest techniques for better:

  • network security
  • system management
  • troubleshooting
  • performance tuning
  • virtualization
  • cloud computing

 on Windows, Linux, Solaris, and popular varieties of Unix.

http://www.admin-magazine.com/

  linux-magazine.com » Issues » 2009 » 100 » Squid at Home  

Print this page. Recommend
Share

Filtering home Internet access with Squid

Parental Guidance

fo_9793737_haende-schrerenschnitt_Natascha-Farber.png

© Natascha Farber, Fotolia

Are your children wearing out their eyeballs on the Internet? Squid will help you impose some time limits and filter out inappropriate content.

Corporate networks often use the Squid proxy server to filter Internet traffic. If you are using a Linux system as your home router and firewall, you can also use Squid on a smaller scale to create access rules for your home network. A few simple commands will help you establish a schedule for Internet use and rule out sites with inappropriate content.

Getting Started

These examples assume your Linux home server is acting as a firewall and router. The Linux system will be the only computer on the home network with an Internet connection, and it will act as a proxy server, giving all the other clients access in a way that ensures nobody can work around the filter. For this reason, the router will not forward TCP ports 21 and 80, forcing the clients to access the proxy for the ftp and http protocols.

System Requirements

The information in this article is based on Squid version 2.6 [1]. Debian 4.0 and Ubuntu 8.04 users can simply type apt-get install squid to install the proxy.

The network clients can use any operating system that supports TCP/IP. The clients need a browser entry defining the router as the proxy host (Figure 1).


Figure 1: Configuring a proxy host for a web browser.

Basic Configuration

The /etc/squid/squid.conf file is at the center of your Squid configuration. A version of this squid.conf file with useful comments is available on the web [2].

The first step is to make sure the firewall blocks incoming requests for the proxy from all external networks. This precaution prevents third parties from using the server for Internet access.

Listing 1 gives two approaches for blocking requests from external networks – make sure you customize these entries to match your own environment. It is a good idea to start by blocking all the ports on the firewall and then explicitly allowing only those ports you really need.

Listing 1

Blocking External Access

01 # Approach 1
02 # drops incoming requests for Squid port 3128,
03 # except for requests from the 192.168.1.* network
04 iptables -I INPUT -p tcp --dport 3128 -s ! 192.168.1.0/24 -j DROP
05
06 # Approach 2
07 # drops incoming requests for Squid port 3128,
08 # except for requests from the eth0 NIC (local network)
09 iptables -I INPUT -p tcp --dport 3128 -i ! eth0 -j DROP

If you apply multiple examples at the same time, the order and the combination of parameters is important. For more details, read the Squid help files. To force the program to parse the updated configuration, just type /etc/init.d/squid reload at the command line. (See the box titled "Critical Security Information" for some security tips.)

Critical Security Information

The proxy configuration will depend on your network structure. This article is simply intended as a guide, and it assumes a working configuration with the Ubuntu 8.04 packages, including Squid version 2.6.STABLE18. Other distributions or versions might require a different approach.

Before you boot the system, it makes sense to check out the Squid manual and ensure that your system really is secure. An open and incorrectly configured proxy is just as bad as an unprotected WLAN: It would theoretically allow any Internet user to surf the web with the proxy owner's identity. The proxy owner would then be liable for anything these unauthorized users did. A working firewall, up-to-date packages, and a secure Squid configuration are thus mandatory.

Read full article as PDF » 052-054_squid.pdf 294.58 kB


Comments


Print this page. Recommend
Share
Related Articles
Tor and Privoxy Anonymous surfing with Tor and Privoxy
Charly's Column The Sysadmin’s Daily Grind: Tor
Squid proxy server Implementing a home proxy server with Squid
Web Filters Privoxy and Webcleaner content filters
Safer Surfing Staying ahead of Internet snoopers and con men
Wherever you go...

...Linux Magazine goes with you!

Check out the advantages of a Digital Subscription:

  • Access articles by downloading PDFs,
  • find the Linux solutions you need with an easy keyword search,
  • maintain your own paperless archive...

more...