<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Squid (Forward) Proxy - Setting Outbound Interface&#x2F;Gateway]]></title><description><![CDATA[<p dir="auto">I've installed Squid as a forward proxy and the basic functionality is working well.</p>
<p dir="auto">The proxy traffic is going out my WAN currently, but I want to go out of either a Gateway Group (has 2 VPN gateways in it) I have setup, or a specific OpenVPN Interface if I cannot target a Gateway Group.</p>
<p dir="auto">There is no option I can see where I select the outgoing interface used for proxy requests.</p>
<p dir="auto">I've examined the Firewall Entries to see if I can somehow target the outgoing requests based on IP or Port, but I can't. It comes from the default pfSense IP and with a random port, nothing specific to let me target proxy-only traffic via firewall rule.</p>
<p dir="auto">I also considered using a virtual IP for Squid (say 192.168.1.2) with the hope that proxy requests will come from 192.168.1.2 as a result, however I'm unable to get this working. I've added the Virtual IP, and it works, I can access pfSense no problem. But, when trying to use 192.168.1.2 as the Proxy IP, no requests go through. The firewall shows the incoming request for 192.168.1.2:3128 and it is accepted, however there is no matching rule from 192.168.1.2:* to DestinationIP:Port. It's not a case of firewall logging settings either, if I use 192.168.1.1 as the proxy IP I see both the inbound and outbound proxy requests. I expect the issue here is Squid binding to LAN which is 192.168.1.1, so it doesn't catch 192.168.1.2 traffic.</p>
<p dir="auto">It seems I can likely achieve my goal by either:<br />
– Changing outbound interface for Squid to a Gateway Group or specific interface<br />
-- Binding Squid to 192.168.1.2<br />
-- Finding out how to identify Squid outbound traffic so I can target it with a firewall rule</p>
<p dir="auto">If anyone is able to offer a suggestion that would be amazing, thank you.</p>
]]></description><link>https://forum.netgate.com/topic/130350/squid-forward-proxy-setting-outbound-interface-gateway</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 02:51:20 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/130350.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 01 May 2018 09:27:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Squid (Forward) Proxy - Setting Outbound Interface&#x2F;Gateway on Fri, 04 May 2018 04:16:57 GMT]]></title><description><![CDATA[<p dir="auto">I had the same issue. After searching I found a solution, I don't remember who posted these or I'd give them props. You'll need something like this in your Squid advanced options:</p>
<pre><code>acl vpn_clients src 192.168.1.0/24
tcp_outgoing_address xxx.xxx.xxx.xxx vpn_clients
</code></pre>
<p dir="auto">You'll also need a way to update the outgoing address if it's not static. I have a cron job to run this:</p>
<pre><code>#!/bin/sh

# Variables
VPN_IFACE=ovpnc1
SQUID_CONFIG_FILE=/usr/local/etc/squid/squid.conf

# Get current IP address of VPN interface
VPN_IFACE_IP=$(ifconfig $VPN_IFACE | awk '{print $2}' | egrep -o '([0-9]+\.){3}[0-9]+')

# Check if VPN interface is up and exit if it isn't
if [ -z "$VPN_IFACE_IP" ]
then
        exit 0;
fi

# Check current IP for VPN interface in squid.conf file
VPN_CONFIG_IP=$(grep -m 1 "tcp_outgoing_address" $SQUID_CONFIG_FILE | awk '{print $2}' | egrep -o '([0-9]+\.){3}[0-9]+')

# Check if the config file matches the current VPN interface IP, and if so exit script
if [ "$VPN_IFACE_IP" == "$VPN_CONFIG_IP" ]
then
        exit 0;
fi

# Replace the previous IP address in the squid.conf file with the current VPN interface address
sed -ie 's/'"$VPN_CONFIG_IP"'/'"$VPN_IFACE_IP"'/' $SQUID_CONFIG_FILE

# Force reload of the new squid.conf file
/usr/local/sbin/squid -k reconfigure

</code></pre>
]]></description><link>https://forum.netgate.com/post/764132</link><guid isPermaLink="true">https://forum.netgate.com/post/764132</guid><dc:creator><![CDATA[deagle]]></dc:creator><pubDate>Fri, 04 May 2018 04:16:57 GMT</pubDate></item><item><title><![CDATA[Reply to Squid (Forward) Proxy - Setting Outbound Interface&#x2F;Gateway on Tue, 01 May 2018 09:49:21 GMT]]></title><description><![CDATA[<p dir="auto">Small update</p>
<p dir="auto">I added this to the Custom Options:<br />
http_port 192.168.1.2:3128</p>
<p dir="auto">and I can now use 192.168.1.2 as the proxy IP, but it doesn't help. For example:</p>
<p dir="auto">My PC to Proxy:<br />
192.168.1.XXX:56209 192.168.1.2:3128</p>
<p dir="auto">pfSense to WAN:<br />
[My WAN IP]:59142 151.101.29.140:443</p>
<p dir="auto">Still no way to target the outbound request (that I can see)</p>
]]></description><link>https://forum.netgate.com/post/763520</link><guid isPermaLink="true">https://forum.netgate.com/post/763520</guid><dc:creator><![CDATA[rx512]]></dc:creator><pubDate>Tue, 01 May 2018 09:49:21 GMT</pubDate></item></channel></rss>