OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 16.7 Legacy Series »
  • Opnsense Bridge with Squid transparent problem
« previous next »
  • Print
Pages: [1]

Author Topic: Opnsense Bridge with Squid transparent problem  (Read 4640 times)

QQGOD

  • Newbie
  • *
  • Posts: 6
  • Karma: 2
    • View Profile
Opnsense Bridge with Squid transparent problem
« on: November 25, 2016, 01:40:35 pm »
Opnsense works in bridge mode.
Squid works in transparent mode.
The http request can be filtered by squid.

BUT there is a problem, the outside web server shows the request is from the opnsense bridge interface(ip1), not from the computer(ip2) behind the bridge.

webserver <--->opnsense bridge(ip1)<--->inner computer (ip2)

How to fix this?
Let webserver finds request from ip2, as opnsense bridge is totally transparent.
Logged

bartjsmit

  • Hero Member
  • *****
  • Posts: 1594
  • Karma: 167
    • View Profile
Re: Opnsense Bridge with Squid transparent problem
« Reply #1 on: November 25, 2016, 06:08:17 pm »
Isn't that what a proxy is supposed to do? If you want the traffic to come from the source, you need to by-pass Squid.

Bart...
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13906
  • Karma: 1206
    • View Profile
Re: Opnsense Bridge with Squid transparent problem
« Reply #2 on: November 25, 2016, 06:19:48 pm »
Transparent means transparent for the client in this case, not transparent for the server. :)
Logged

QQGOD

  • Newbie
  • *
  • Posts: 6
  • Karma: 2
    • View Profile
Re: Opnsense Bridge with Squid transparent problem
« Reply #3 on: November 29, 2016, 07:25:33 am »
Thanks!

But how to achieve client transparency in this scenario?
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13906
  • Karma: 1206
    • View Profile
Re: Opnsense Bridge with Squid transparent problem
« Reply #4 on: November 30, 2016, 09:05:48 am »
You said "Squid works in transparent mode." Then you said "client transparency". That's the same.

If you mean server transparency, you need to put your proxy behind NAT.

If you want your servers to see the clients and still do proxying, there are other products for this we cannot possibly support...


Cheers,
Franco
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Opnsense Bridge with Squid transparent problem
« Reply #5 on: November 30, 2016, 05:08:44 pm »
the proxy can add the source ip as an header (X-Forwarded-For, see http://www.squid-cache.org/Doc/config/forwarded_for/). You can set it in the GUI if that is what you want to do.
Logged

QQGOD

  • Newbie
  • *
  • Posts: 6
  • Karma: 2
    • View Profile
Re: Opnsense Bridge with Squid transparent problem
« Reply #6 on: December 12, 2016, 10:35:16 am »
What "other products" can achieve this?

Now, only additional IPFW rules on the proxy and the server can achieve this: the server see the real clien ip address.

It seems the “divert-reply" option of pf can work for transparent proxy, but it does not work , maybe the kernel does not implement it.

Quote from: franco on November 30, 2016, 09:05:48 am
You said "Squid works in transparent mode." Then you said "client transparency". That's the same.

If you mean server transparency, you need to put your proxy behind NAT.

If you want your servers to see the clients and still do proxying, there are other products for this we cannot possibly support...


Cheers,
Franco
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 16.7 Legacy Series »
  • Opnsense Bridge with Squid transparent problem
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2