Tutorial details | |
---|---|
Difficulty | Intermediate (rss) |
Root privileges | Yes |
Requirements | Squid v2.6+ |
Time | N/A |
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
🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.
🐧 4 comments so far... add one ↓
🐧 4 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
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
please help me , i searched a lot but i didnt find any where.
hey squid can u please tell me your server that u play on and what day and what time
thank u
Guys, i need my web cache to show client or system’s exact IP public address instead of showing its own IP.
Thanks in advance.