Markus Blog What's going on Internet?

20Jan/09115

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 (115) Trackbacks (7)
  1. what is your OS? where did you install Softperfect Bandwidth Manager? do you use client server scheme or only install it on your own PC?

    have you check your log file? what is your squid.conf content?

  2. Such, I installed the squid, I can navigate the manual form, but the problem is q is not clear, I have windows server 2003 mounting procedures in conjunction with bwm

    I doubt ..

    network connections and should practice to be par bwm wing configuration?

    You must have made the network bridge?
    or without the bridge?

  3. Can this method be used from an external computer (as in hosting a proxy server by like ip:port proxy for an outside client to connect an use by setting it in lan/proxy server settings in ie’s internet options?? for example like hidemyass.com’s ip:port list?)

  4. if we use it for 20 clients…..can it be possible to use this tutorial??? how about bottleneck if am use it for 20 clients? thanks..

  5. hello sir markus i just wanna as if this is possible to setup softperfect with squidNT in this network setup..by the way this is the setup: DSL/Internet—router–switch–server and workstations..btw this is a setup for an internet cafe shop.. i want to install softperfect and squid in server..i’ve already configure my squidNT in server and its running smooth..when i install softperfect and configure it..i have no internet connection, then i remove softperfect, my connection had back again..what do you think is the problem..

    thanks!

  6. btw im using windows xp pro SP3 in my server..thanks!!

  7. hi,
    How to solve below these problems:
    1. specific website non-blocking.
    2. bandwith users control
    3. specific time access user
    Please send me the solution in Squid.confi. details on my email address.

  8. Hi markus i configured my squidnt in windows server 2003 and it ‘s runing, the only probleme is with outlook express; in client machine we can’t send or receive message with outlook, so i tried to use Softperfect Bandwidth Manager to redirect the port 25 and 110 to the squid listen port 80. but my problem persist.
    please help i need to resolve this problem as soon as possible :’(

  9. hello,

    how about, how to allow program using http: i have program using http:\appserver\kafis\login.aspx

  10. So port redirecting is possible on Windows, but unfortunately only with a commercial software. Why nobody had created a free software to do such things?

  11. Port forwarding is possible on windows:
    c:\>netsh
    netsh > interface portproxy
    netsh interface portproxy > add v4tov4 listenport=8080 connectaddress=192.168.1.28 connectport=8080

    more info: http://technet.microsoft.com/en-us/library/cc731068%28WS.10%29.aspx

  12. Hi marku,i have configure squid for transparent but i am having the Error code: ssl_error_rx_record_too_long.is there any solution for it.do i need to recompile squid after making changes to squid.conf file?

    • i didn’t get that problem at the time i’m installing squid. that error message most of the time means broken ssl certificate (and it’s server side) so you have to fix it on your web server and not squid.


Leave a comment

(required)


*