LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-14-2015, 06:17 PM   #1
naishal0748
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Rep: Reputation: Disabled
squid tcp_outgoing_address feature not working


Hello,

I have setup squid transparent proxy with following configurations in centos 6.2 :

eth0 - LAN Network
eth1 - WAN1 - IP - 192.168.3.15 - Gateway IP - 192.168.3.1
eth2 - WAN2 - IP - 192.168.5.15 - Gateway IP - 192.168.5.1 (Default Gateway)

I want to route 10.2.0.0/16 traffic to WAN1

I have used my squid.conf file to mention that as below

acl localnet src 10.2.0.0/16

tcp_outgoing_address 192.168.3.15 localnet

But all the traffic is going through eth2 only. I want all the traffic to go through eth1 based on my source address.

I have already setup routing on my linux server for eth1 and eth2.

Someone please help.
 
Old 04-16-2015, 08:50 AM   #2
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
You can probably use iproute2 to handle this. After installing it:

add a routing table entry to /etc/iproute2/rt_tables, something like
Code:
10    squid
then add a default route for that table, you'll probably want to put this in some network script so it happens after a reboot
Code:
ip route add default via 192.168.3.1 table squid
and a rule to direct traffic to that table
Code:
ip rule add from 192.168.3.15 table squid

personally I'm a bit lazy and instead of looking up the appropriate script to put them in, since I'm on debian I just throw them in my interfaces file (but I'm using static interfaces as well)

excerpt from /etc/network/interfaces
Code:
auto eth1
iface eth1 inet static
  address 192.168.3.15
  netmask 255.255.255.0
  up ip route add default via 192.168.3.1 table squid
  up ip rule add from 192.168.3.15 table squid

Last edited by estabroo; 04-16-2015 at 08:55 AM. Reason: added interfaces info
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Squid+DansGuardian not working properly. squid blocking sites that should be linuxlover.chaitanya Linux - Server 13 11-10-2014 10:34 AM
Squid: adding unique host_name to each tcp_outgoing_address cybersysop Linux - Software 2 10-02-2012 11:56 AM
squid tcp_outgoing_address yorbs8 Linux - Networking 0 05-24-2010 09:12 AM
Squid 2.6 Reverse Proxy from Squid(3128) to OrginServer(80) Not working rraj Linux - Server 0 06-06-2008 02:29 PM
Daily Digest Feature Not Working danny_beta_read LQ Suggestions & Feedback 1 03-31-2004 09:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration