| Tutorial details | |
|---|---|
| Difficulty | Intermediate (rss) |
| Root privileges | Yes |
| Requirements | Squid v2.6+ |
You need to configure the option tcp_outgoing_address in squid.conf file. This option allows you to map requests to different outgoing IP addresses. The IP address can be based on the username or source address of the user making the request. The syntax is:
tcp_outgoing_address YOUR-IP-ADDRESS-HERE
Configuration
Edit the squid.conf file:
# vi /etc/squid/squid.conf
Find or add the following configuration directive:
tcp_outgoing_address 1.2.3.4
Save and close the file. Reload the squid proxy server / config file changes by typing the following command:
# squid -k reconfigure
OR
# service squid reload
Setting up multiple outgoing IP addresses
You can forward clients request based on IPs for certain users:
#define acl acl admin 192.168.1.100 acl tom 192.168.1.101 acl raj 192.168.1.102 # set up outgoing rule tcp_outgoing_address 192.168.1.254 admin tcp_outgoing_address 192.168.1.253 tom tcp_outgoing_address 192.168.1.253 raj
However, forwarding clients with dedicated IPs for certain subnets is more useful:
## full filtering enabled using iptables on 10.0.0.0/24 and routed via squid## acl throttle_service_net src 10.0.0.0/24 ## admins are skip from this limits ## acl admins_service_net src 192.168.1.0/24 ## Set rules ## tcp_outgoing_address 10.1.0.2 throttle_service_net tcp_outgoing_address 192.168.1.254 admins_service_net
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 1 comment… read it below or add one }
I installed squid transparent proxy server in one system(eth0=192.168.1.203 ,eth1=192.168.3.5) I deployed one application in one system (proxy Client, eth0=192.168.3.60) .We have router with IP 192.168.1.1
Now i can access this application from lan (proxy server area 192.168.3.0/24) .But i am unable to access this application from 192.168.1.0/24 and External network.
Can you please help me how can i give remote access of app. of proxy client system.
Thanks, Srinivas