Markus Blog What's going on Internet?

20Jan/09111

Squid Transparent Proxy Server on Windows Server 2003


In this article I’ll talk on how to setup a transparent proxy on Windows Server 2003 using Squid NT. Squid NT is a port from Linux base proxy server called Squid. I have successfully installed and configured Squid transparent proxy on Windows Server and here is how I do it.

Installing Squid NT is very easy, first you can download Squid NT here, and then you can follow my old tutorial here: http://markus.revti.com/2007/06/installing-squid-cache-for-windows/

Although installing Squid NT is easy, however configuring transparent proxy on Windows version of Squid is a bit tricky as Squid NT have its limitation. From Squid NT website it’s stated: “Transparent Proxy: missing Windows non commercial interception driver”.

My first thought was there is no way to do port forwarding or port redirecting in Windows Server the same way it is done in Linux server. In Linux based server you can use iptables to do port forwarding with the command like this:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128

I’ve been looking for a way to do port redirect or port forwarding in Windows Server 2003 this several days and start to become desperate as not much info I can get on this topic. At first I was looking for doing port forwarding or port redirecting in RRAS (Routing and Remote Access Service) but can’t find it. Actually there is port forwarding in RRAS but it’s not what I need to make transparent proxy.

Then I start looking for software that can do port forwarding and found Softperfect Bandwidth Manager can do it. You can download Softperfect Bandwidth Manager here.

Step by step to configure transparent proxy using Softperfect Bandwidth Manager:

Let start by installing the Squid NT, use my old tutorial here http://markus.revti.com/2007/06/installing-squid-cache-for-windows/ to guide you.

Then you'll need to modify the squid.conf to add "transparent" keyword behind http_port options so it will look like this:

http_port 3128 transparent

Install Softperfect Bandwidth Manager

Create a Port Map, here you should define the Squid’s port on your server. Go to “Tools > Port Mapping”

Softperfect Bandwidth Manager's Add Port Map

Softperfect Bandwidth Manager's Add Port Map

Click on New button to create a new mapping, fill like the example below

Softperfect Bandwidth Manager Adding New Port Map

Softperfect Bandwidth Manager Adding New Port Map

After you create a port map, you need to create a new rule to redirect all HTTP request to remote server port 80 to port 3128. Click on “Rules > Add Rule”. On General tab fill the fields with these values:

Direction: Both
Transfer Rate Limit: Unlimited
Protocol: TCP and UDP
Apply Rule on Interface: LAN

Softperfect Bandwidth Manager Rule General Tab

Softperfect Bandwidth Manager Rule General Tab

Important! You must select the interface (Network Card) that is connected to your Local Network (the one that connect the server to other client computers, and NOT the one connected to the modem, etc.)

On Source tab set the values to these:

Source Address: Whole IP Address, and insert the IP ranges of your clients PC
Source Port: Any

Softperfect Bandwidth Manager Source Tab

Softperfect Bandwidth Manager Source Tab

On Destination tab set the values to these:

Destination Address: Any IP Address
Destination Port: Port List and then Add these ports: 80 (HTTP) and 443 (HTTPS)

Softperfect Bandwidth Manager Destination Tab

Softperfect Bandwidth Manager Destination Tab

On Advanced tab look for “Additional Processing”, give check on “Process through the following mapping” and select the port mapping you created before and click OK.

Softperfect Bandwidth Manager Advanced Tab

Softperfect Bandwidth Manager Advanced Tab

Done, now all requests to port 80 and 443 will be redirected to Squid NT. To check whether the transparent proxy works or not you can visit http://whatismyipaddress.com/ and it should say “Proxy Server Detected!”

Download Squid NT and Softperfect Bandwidth Manager here

Bookmark and Share

Related Article

Comments (111) Trackbacks (7)
  1. how i will active Squid + Softperfect Bandwidth Manager for webcams support?

    • what problem do you encounter? squid + softperfect shouldn’t be have anything to do with webcam, unless the software need a port to be opened to transfer the video, in this case you have to ask the software provider what ports they use.

  2. i try to install a transparent proxy under windows xp professional.

    i made all steps.. but it\’s only work if i set the proxu setting in the internet explorer 8

    if i set the port 3128 or port 80 work\’s fine.. but in transparent mode no..

    any idea?

    • do you have firewall installed?

      does the win xp is the internet gateway on your network? the pc which you install the squid proxy server + Softperfect Bandwidth Manager must be the internet gateway other wise it won’t work.

  3. Hey Buddy, tanks for the tuto.

    I have a problem, when i try to open secure web pages (https) my connection fail.
    can you helpme with this?

  4. Hi, i have windows 2003 enterprice, squid 2.7 stable6 and softperfect, i try to install a transparent proxy but made all steps but it’s only work if i set the proxy setting in the internet explorer in transparent mode not work, my win 2003 have two cards, but, if i set the web page ip address work. any idea??

    • “web page ip address work”

      if you can access website by its ip address and not by domain name, it probably the DNS setting on squid.conf is not configured yet.

      does all client use the windows 2003 server as gateway? on client pc, check “Local Area Connection Status”, the field “Default Gateway” must point to the windows 2003 ip address

  5. Markus can you post new actualized post because you r the only one page of transparent proxy over windows on google!

  6. I came across this artical and had few questions. Is it possible to change this program to authenticate against a database? for example, a database consists of username / password. Only people who have correctly authenticated can access internet.

    My last question is, is it possible to run transparent proxy on Windows Vista or Windows 7 computer?

    Thanks

  7. I did everything exactly described in this topic but couldn’t have the transparent proxy working….
    I will describe in detail about the steps I did

    The computer which must be configured as Squid server and transparent proxy has Windows XP SP2…..
    I have one LAN Card and its IP address is 192.168.0.100…
    I have installed Squid successfully which listens in port 3128 with “http_port 3128 transparent” in squid.conf….
    SBM installed successfully and configured exactly as the same way it was instructed….
    Squid is running successfully…. I have tested in one Client PC by setting browser Proxy setting to 192.168.0.100:3128…. websites are being fetched successfully….

    but when I remove the proxy setting then websites are not being fetched…

    Client computer’s IP address is 192.168.0.101
    net mask 255.255.255.0
    gateway 192.168.0.100
    dns 192.168.0.100

    is this the correct setting or not….

    transparent proxy not working please help………

  8. I did everything exactly described in this topic but couldn’t have the transparent proxy working….
    I will describe in detail about the steps I did

    The computer which must be configured as Squid server and transparent proxy has Windows XP SP2…..
    I have one LAN Card and its IP address is 192.168.0.100…
    I have installed Squid successfully which listens in port 3128 with “http_port 3128 transparent” in squid.conf….
    SBM installed successfully and configured exactly as the same way it was instructed….
    Squid is running successfully…. I have tested in one Client PC by setting browser Proxy setting to 192.168.0.100:3128…. websites are being fetched successfully….

    but when I remove the proxy setting then websites are not being fetched…

    Client computer’s IP address is 192.168.0.101
    net mask 255.255.255.0
    gateway 192.168.0.100
    dns 192.168.0.100

    is this the correct setting or not….

    transparent proxy not working please help………

    and I forgot to mention that in the Squid PC I connect to the internet using ADSL MODEM configured at bridge mode… so I have created a dial up broadband connection…. and I connect to the internet using this dial up broadband connection…..

  9. if you can browse with manual proxy setting, then your squid is installed correctly. so there must be something wrong with the Softperfect Bandwidth Manager settings.

    what ip address did you put in on “Softperfect Bandwidth Manager Source Tab” see above image to check which window i meant.

  10. https not working in transparent mode.
    When i enter 443 in softperfect to forward to squid then secure webs do not open.

  11. Hi, im newbie and have install squid and Softperfect Bandwidth Manager but can’t understant how to configure to use it in my network. In Server work but not in others computers.

    thanks

  12. Hi, I am trying to set up Squid on my windows 2008 server so I can use it as a proxy server for a PC in another country.
    I want to simply put in my PC’s browser proxy the server’s IP address and port (3128) and bingo I can browse through the proxy.
    The guide above seems to be for a LAN and not a WAN. Can it be used to work externally?

    I have tried for hours and no matter what I do I just get the page with “Error – The requested URL could not be retrieved – Access Denied”, with the reference to Squid at the bottom.

    Please can someone help me get this to work?

  13. Are you available for hire to help me optimize my squid config?

  14. Hi Markus,

    I have installed SquidNT 2.5.STABLE1-CVS WWW Proxy Server on my windows 2003 box and its working fine in case of browsing sites. But when i tried configure microsoft outlook express from one of my windows xp client machine it does’nt work. what would be the problem?? can u help me in resolving this problem.

  15. Require some more. snaps of Squid…….

    How to configure squid steps by steps in windows server with snaps…….

    please

    thanks in advance
    vasim

  16. can i activate this on my own server? im a bit confused, would i not be just as well to use a proxy like http://www.piratebayproxy.org?

    • yes you can. with proxy site all over the internet, you’ll never know what they do when you use them to access the web, furthermore if you accessing password protected website, they could get your username and password.

  17. Great tutorial Markus!!!
    really appreciate ur effort

  18. Nice tuto Markus.

    other way round to make squid as transparent proxy on xp box:

    nat (netsh) + active wall pro + squid

    active wall >>>> http://en.lanctrl.com

    thanks

  19. Hi Marcus, I’m trying to install squid 2.7 on a windows 2008 server. The same config works fine on 2003 but on 2008 it keeps prompting for credentials (i’m using ntlm authentication). Reguardless of the credentials I enter it never authenticates me. Any ideas?

    Thanks

    • Hi Bill,

      I didn’t use Windows server 2008 and NTLM so I don’t really know. but have you tried the proxy without NTLM authentication? maybe it get’s blocked by the firewall. Try check the log file too..

      • Hi markus,

        graet tutorial, but my intranet not working when im using proxy i have program using http inside my network please help

  20. Hi Markus,
    i set the softperfect bandwidth manager step by step with u tuto, but i can only use in Internet Explorer ,transparent proxy isn’t work .
    any idea?


Leave a comment

(required)


*