multiple squid proxies routing on different intenet intfaces

Taking care of your Linux box.
Post Reply
zafar466
Lance Naik
Posts: 48
Joined: Sat Sep 30, 2006 1:50 pm

multiple squid proxies routing on different intenet intfaces

Post by zafar466 »

hello guys,

i am working to install two squid proxies on one same machine . ( that would not be difficult part i think ) . i have two different internet connections . and i want that if i install two proxies (say squid1 and squid2) the requests to internet from squid1 must be routed throug interface1 and request from squid2 routed through interface2. I have slight idea of working on iptables and routing commands but not able to implement the above scenario . please send me your suggestions in this regard.

regards
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear zafar466,
Salam,

Below link might help you if you can understand.

FYI, http://www.linuxpakistan.net/forum2x/vi ... t=15#19849

Best Regards.
Farrukh Ahmed
zafar466
Lance Naik
Posts: 48
Joined: Sat Sep 30, 2006 1:50 pm

Post by zafar466 »

thanks for your attention llinuxfreak .

infact i want to tell squid to send its internet request from a specified interface . so if two squids ( or suppose any two applications) are running i will instruct them to send their packets from two different internet connections .
is it possible

regards
nayyares
Battalion Quarter Master Havaldaar
Posts: 237
Joined: Tue Dec 13, 2005 10:47 pm
Location: JNB, SA
Contact:

Post by nayyares »

zafar466 wrote:thanks for your attention llinuxfreak .

infact i want to tell squid to send its internet request from a specified interface . so if two squids ( or suppose any two applications) are running i will instruct them to send their packets from two different internet connections .
is it possible

regards
Hi,

One solution is to take traffic on different ports that will help you to redirect to required outgoing-interface, other use seperate subnets in your LAN for each outgoing-interface and do simple redirection on source address base iptables rules.

thanks
Nayyar Ahmad
RHCE, CCNA, OCP DBA
nayyares aT fedoraproject DoT org
blogs: nayyares.blogspot.com
zafar466
Lance Naik
Posts: 48
Joined: Sat Sep 30, 2006 1:50 pm

Post by zafar466 »

thanks for your reply nayyares


can i tell squid to use specific source ports when it sends its request to internet .
i think if we define source ports for squid we will use snat of iptables and this way we will be able to send the traffice from desired interface .


waiting for your reply guys

regards
nayyares
Battalion Quarter Master Havaldaar
Posts: 237
Joined: Tue Dec 13, 2005 10:47 pm
Location: JNB, SA
Contact:

Post by nayyares »

hi,

you can make squid listen on multiple ports using http_port tag in squid.conf, and yes using SNAT you can sent with any Public IP in your packets to internet.

enjoy
Nayyar Ahmad
RHCE, CCNA, OCP DBA
nayyares aT fedoraproject DoT org
blogs: nayyares.blogspot.com
newbie
Company Havaldaar Major
Posts: 156
Joined: Thu Aug 08, 2002 4:18 am
Location: lahore

tcp_outgoing_address

Post by newbie »

just learn howto use

tcp_outgoing_address

in squid.conf.
kbukhari
Major General
Posts: 1222
Joined: Sat Dec 31, 2005 12:29 am
Location: Lahore
Contact:

Post by kbukhari »

dear zafar466,
newbie's answer will help you in this regard for your help here is an example
let se you are your are getting ips like
ISP1 ***.***.59.5
ISP2 ***.59.**.6

just add

1st squid.conf
http_port 8080
tcp_outgoing_address ***.***.59.5

2nd squid.conf
http_port 3128
tcp_outgoing_address ***.59.**.6
in your senerio running 2 squids will help your to redirect trafic as clients based
--
Syed Kashif Ali Bukhari
+92-345-8444420
http://sysadminsline.com
http://kashifbukhari.com
Post Reply