Re: [squid-users] Return IP Address

From: Colin Campbell <sgcccdc@dont-contact.us>
Date: Fri, 22 Mar 2002 16:55:44 +1000 (EST)

Hi,

On Thu, 21 Mar 2002, Chandrakant Sharma wrote:

> Dear All,
>
> Let me explain the problem in proper way.
>
> The Squid is configured with two NICs (we will call it
> as WAN and LAN NIC). The WAN NIC IP Address is
> 192.168.0.1/30, the LAN IP Address is 192.168.1.1/30.
> The same box is acting as a DHCP Server providing IP
> addresses from scope 192.168.2.0 -to- 192.168.2.254.
>
> Say a customer is connected to my Network and gets
> 192.168.2.1 from DHCP pool. My query is when the squid
> service is enabled, the outgoing request goes with WAN
> IP i.e 192.168.0.1, which i do not want. I want the
> outgoing IP Address should be client IP Address i.e.
> 192.168.2.1. This I can achieve when I stop the Squid
> Service, then the outgoing request is with actual IP
> Address i.e. 192.168.2.1.

When squid is not running the system is acting as a router. Addresses do
not get changed. When you run squid you are running a proxy. There are two
connections - one form the browser to squid and one form squid to the
server. The operating system will put the address of the NIC the packets
leave from into the packets. Let's say that somehow, the packets went out
with 192.168.2.1 instead of 192.168.0.1. The server would then respond to
192.168.2.1. When the packets came back they would not be seen by squid
and would be forwarded by operating system to the host with 192.168.2.1.
Since that machine would not have a connection to the server (remember it
connected to the squid) it would drop the packets. So, the client would
not see them and squid would not see them.

Colin
Received on Thu Mar 21 2002 - 23:55:52 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:07:02 MST