Accessing another subnet behind proxy

routingsquid

I have squid proxy with dansguardian with ip x.x.1.125 and all computer have this ip as their gateway. Now I need them to access an application on x.x.othernetwork.41 ip. But when I turn on ip forwarding, they can access this ip but the internet becomes open even without proxy settings in the browser. In other words, the users get full access internet when I enable forwarding.

I want them to access this application on another subnet but also access internet through proxy only.The proxy can ping the software ip x.x.othernetwork.41.

x.x.1.125 has single network card.

Thanks

Best Answer

There are different ways of achieving this.

  • You may add firewall rules using iptables in the proxy server that will block outgoing connection to port 80/443 for local LAN, so that the users won't be able to use internet without using the proxy.
  • Disable IP forwarding in the proxy server and configure proper route to the other network using route command so that the packet are routed to the right gateway to reach the other network.

The problem is in your setup, you are using the proxy server as gateway, which is actually not a router, as you have said, it has only one ethernet interface. So you should consider configuring your LAN so, that the computers are configured with the correct/actual gateway address. This way they will be able to reach other networks without going through the proxy server. A proxy server doesn't need to be the default gateway to work properly.