I have Ubuntu 12.04 installed on my system to use as a server in my office having 50 employees. I have 2 LAN cards in my system:

  1. One for input from a BSNL router ( to my Ubuntu server (
  2. Another one from the server ( to a switch which connects all the employees through squid from that switch via LAN cables.

How can I configure both LAN cards and squid, as I wants to block some sites and make some restriction on the network.


You can add needed blocked sites to your blacklist in /etc/squid/squid.conf

acl     localnet   src               #define localnet
acl     blacklist dstdomain "/etc/squid/blacklist"     #define blaclist

http_access deny blacklist
http_access allow localnet



List the domains you want to block, starting with '.' to include hostnames/subdomains :



Note that filtering through a proxy server only works if the browser is configured to use the proxy, and that direct access to the internet is blocked or the user is prevented from modifying the proxy settings of the browser(s)

Personally if your looking to block just inappropriate website's from use on the computer i would use a network management app like Parental Control or Content Filter.

  • FWIW: Always tell new admins to whitelist; easier to maintain. Also: his routing issue wasn't addressed: you should tell OP that that is off-topic here (he has a duplicate IP the way he configured his network, so your solution will never work neither as the network won't work anyway) – Fabby Feb 15 '16 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.