0

I have two interfaces in my ifconfig, eth0 and eth1. Squid is set to accept connections from both of them on port 3000.

However, eth0's ip address is always used to send proxy requests, even if client has connected using eth1 address.

How do i force squid to always use just the source IP as tcp_outgoing_address (without writing this IP in config file)?

What i've tried additionally:

acl from_eth0 src A.B.C.D/1
acl from_eth1 src E.F.G.H/1

tcp_outgoing_address A.B.C.D from_eth0
tcp_outgoing_address E.F.G.H from_eth1

If i need to use iptables, how exactly rules will look for me?

0

There are many types of acl. src means the client IP and not the interface IP (local address).

I use localip acl type for that purpose:

acl from_eth0 localip A.B.C.D
acl from_eth1 localip E.F.G.H

tcp_outgoing_address A.B.C.D from_eth0
tcp_outgoing_address E.F.G.H from_eth1
tcp_outgoing_address 1.2.3.4 # default

ACL types are described in doc page.

However, it's painful to write each address by hand. I don't think it's a final solution because of that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.