Configure Squid Proxy To Forward Package To A Parent Proxy


Squid is an Open Source Unix-based proxy server for the Web supporting HTTP, HTTPS, FTP, and more. It has extensions like web page caching to reduce bandwidth and improve response times. Squid is provided as free, open source software and can be used under the GNU General Public License.

Basically, Squid will act as an intermediary, passing the client’s request on to the destination (server). We are  going  to take  a  look  how to configure  proxy to  proxy  communication with  squid proxy.  We will create a test case that two proxy servers forward specific package over defined port between them. Not only one server will be parent proxy both of them will be act like parent.

So we got access from firewall side  from one  proxy  to another  one  for specific  port which we ‘ll use to  communicate  Proxies.  If you have  an application,  your  application can access  agents over  Proxies and also  agent can access  server to. Request  comes from agents  will be  forwarded  from  one proxy  to another .

Lets talk about  squid  configuration.First  of all  you need to install  squid proxy  package. I use  this  one which I added below.

For  application Server Package  Flow :

Application Server >> ProxyA >> ProxyB>>Agent

For  Client  Package  Flow :

Agent >> ProxyB >> ProxyA >> Application  Server

# rpm -qa|grep squid



squid-3.1.23-24.el6.x86_64

 

PROXY A configuration :

##This configurations come from default installation.

##Recommended minimum configuration

acl manager proto cache_object

acl localhost src 127.0.0.1/32 ::1

acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1



# Define allowed network alias.

#localnet is just alias.

acl localnet src 192.168.0.0/16



#Define safe ports.

acl SSL_ports port 443

acl Safe_ports port 80 # http

acl Safe_ports port 383 # This is port which agent and client used for our scenario.

acl Safe_ports port 443 # https



acl CONNECT method CONNECT



# Recommended minimum Access Permission configuration:

# Only allow cachemgr access from localhost

http_access allow manager localhost

http_access deny manager



# Deny requests to certain unsafe ports

http_access deny !Safe_ports



# We strongly recommend the following be uncommented to protect innocent

# web applications running on the proxy server who think the only

# one who can access services on "localhost" is a local user

#http_access deny to_localhost



#

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

#



# Example rule allowing access from your local networks.

# Adapt localnet in the ACL section to list your (internal) IP networks

# from where browsing should be allowed

http_access allow localnet

http_access allow localhost



# And finally deny all other access to this proxy

http_access deny all



# Squid normally listens to port 3128.

http_port 3128



# Add any of your own refresh_pattern entries above these.

refresh_pattern ^ftp: 1440 20% 10080

refresh_pattern ^gopher: 1440 0% 1440

refresh_pattern -i (/cgi-bin/|\?) 0 0% 0

refresh_pattern . 0 20% 4320

#Define Parent PROXY with cache_peer

#192.168.199.137 is Other Proxy IP.

cache_peer 192.168.199.137 parent 3128 0 default

#Define rule which package should not forward.

#For our scenario 192.168.145.171 is Application Server IP.

#If a agent send package to Application server. Agent >> Proxy1 >> Proxy2 >> Server.

#If we dont define this rule. It will be a loop like this and package never get by Server.(Agent >> Proxy1 >>Proxy2 >>Proxy1

acl proxy2 src 192.168.145.171/32

never_direct allow proxy2

 

PROXY B Configuration :

##This configurations come from default installation.

##Recommended minimum configuration

acl manager proto cache_object

acl localhost src 127.0.0.1/32 ::1

acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1



# Define allowed network alias.

#localnet is just alias.

acl localnet src 192.168.0.0/16



#Define safe ports.

acl SSL_ports port 443

acl Safe_ports port 80 # http

acl Safe_ports port 383 # This is port which agent and client used for our scenario.

acl Safe_ports port 443 # https



acl CONNECT method CONNECT



# Recommended minimum Access Permission configuration:

# Only allow cachemgr access from localhost

http_access allow manager localhost

http_access deny manager



# Deny requests to certain unsafe ports

http_access deny !Safe_ports



# We strongly recommend the following be uncommented to protect innocent

# web applications running on the proxy server who think the only

# one who can access services on "localhost" is a local user

#http_access deny to_localhost



#

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

#



# Example rule allowing access from your local networks.

# Adapt localnet in the ACL section to list your (internal) IP networks

# from where browsing should be allowed

http_access allow localnet

http_access allow localhost



# And finally deny all other access to this proxy

http_access deny all



# Squid normally listens to port 3128.

http_port 3128

# Add any of your own refresh_pattern entries above these.

refresh_pattern ^ftp: 1440 20% 10080

refresh_pattern ^gopher: 1440 0% 1440

refresh_pattern -i (/cgi-bin/|\?) 0 0% 0

refresh_pattern . 0 20% 4320

#Define Parent PROXY with cache_peer

#192.168.167.134 is Other Proxy IP.

cache_peer 192.168.167.134 parent 3128 0 default

#Define rule which package should not forward.

#For our scenario 192.168.100.0/24 is Client Server's IP segment.

#If Application Server send package to Client server. Ap Server >> ProxyA >> ProxyB >> Client.

#If we dont define this rule. It will be a loop like this and package never get by Client. (AP Server >> ProxyA >>ProxyB >>ProxyA

acl proxy2 src 192.168.100.0/24

never_direct allow proxy2

 

Then you can restart squid proxy and  finished!
 

#service squid restart

 

Tagged In:

I'm a IT Infrastructure and Operations Architect with extensive experience and administration skills and works for Turk Telekom. I provide hardware and software support for the IT Infrastructure and Operations tasks.

205 Total Posts
Follow Me

69 Comments

  1. viagra prix viagra sale no prescription viagra http://genqpviag.com/ - overnight generic viagra ’

  2. how i can get viagra in norway cheapest viagra online canadian pharmacy viagra dosage women http://llviabest.com/ - viagra usa pharmacy ’

  3. pharmacy online prescription paypal viagra brand cialis

  4. blood pressure best canadian mail order pharmacies canadian pharmacy no prescription

  5. buy generic viagra online canadian pharmacy online canada fda approved canadian online pharmacies

  6. canadian cialis canadian king pharmacy online drugs

  7. viagra on line without prescription overnight delivery for viagra 100 mg viagra

  8. viagra and cialis generic cialis india cialis puerto rico

  9. gastro health canadian prescription drugstore online pharmacy india

  10. uk viagra viagra natural para hombres generic viagra dapoxetine

  11. cialis minipille cialis testosteron booster para que se usa el cialis

  12. florida law cash advance payday cash cash advance west mifflin pa

  13. cash loan to pay bills everest cash payday loan instant cash loans nj

  14. real viagra canada best price for sildenafil 100 mg how much is viagra 50 mg

  15. imagen cialis long cialis take effect cialis pharmacie ligne

  16. cheapest generic cialis online cialis bestellen deutschland cialis mail order

  17. cialis us http://buycialisxz.com/ generic cialis made in america

  18. viagra at walgreens penis on viagra viagra effects

  19. coronavirus treatment ivermectin ivermectin 0.08 oral solution is ivermectin over the counter what is the brand name for ivermectin?

  20. albuterol liquid ventolin tablets albuterol sulfate inhalation solution 0.083 side effects what does an albuterol inhaler do

  21. ivermectin praziquantel horses ivermectin cost where to get ivermectin for dogs how to create the best treatment plan for "dog" deworming with ivermectin and fenbendazole

  22. amoxicillin sulbactam amoxicillin 107 amoxicillin 500mg dosage for dogs what is amoxicillin 875 used for

  23. ventolin abuse ventolin buy online buy ventolin hfa inhaler online how often can i use my albuterol inhaler

  24. lasix drug interactions furosemide 40 mg canada lasix for fluid in lungs furosemide 40 mg tablets what number is on the back

  25. amoxicillin davis pdf 625mg amoxicillin can i drink alcohol on amoxicillin what happens when you drink on amoxicillin

  26. furosemide pharmacological class lasix buy online drug interaction between digoxin and lasix is there a pharmacy where i can get lasix without prescription

  27. azithromycin dose azithromycin z-pack can you take azithromycin with alcohol how to take azithromycin 250mg tablets 6 pack

  28. clomid dosing clomid for sale australia is clomid a fertility drug when do you take clomid

  29. doxycycline 100mg tablet 200 mg doxycycline does doxycycline work for sinus infection doxycycline what is it for

  30. prednisolone 50 mg buy prednisolone 40 mg prednisolone acetate 1 eye drops side effects what is prednisolone acetate

  31. doxycycline food interactions doxycycline buy what std does doxycycline treat what is the general purpose of doxycycline hyclate

  32. clomid manufacturer buy clomid from mexico clomid long term side effects where to buy clomid online safely

  33. prednisolone nursing considerations prednisolone 0.5 cream prednisolone vs prednisone with alcohol how long is unopened prednisolone acetate liquid 1% good

  34. dapoxetine analog us priligy tablets in india online dapoxetine require prescription in gernany priligy how long before sex

  35. dapoxetine kaiser can you buy priligy over the counter where to find priligy where can you buy dapoxetine not online

  36. diflucan birth control fluconazole without prescription diflucan or nystatin for candida how to get a standing rx for diflucan

  37. https://dissertationahelp.com/ - dissertation assistance service writing dissertations dissertation writing help uk dissertation only phd

  38. https://thesiswritingtob.com/ - thesis writing service reviews thesis binding editing thesis thesis paper writing

  39. propecia pregnancy propecia 5mg pill how much does propecia cost at walmart how much is propecia from doctor

  40. prednisolone for infants 50 prednisolone switching from prednisolone to budesonide cats how long to let cats live on prednisolone

  41. https://thesisacloud.com/ - thesis service best thesis editing services thesis advice best thesis

  42. neurontin pain management neurontin prices neurontin 800 mg and narcotics gabapentin for what use

  43. effects of metformin buy glucophage uk is metformin a sglt2 inhibitor where to buy metformin 500 mg

  44. paxil nausea buy paxil uk switching from paxil to prozac how a nurse should warn parents about kids taking paxil

  45. psoriasis plaquenil buy plaquenil 10mg plaquenil back pain and headache how can plaquenil help sjogren's

  46. https://thesiswritingtob.com/ - thesiswritingtob.com thesis consulting thesiswritingtob.com help me write a thesis

  47. Valuable info. Lucky me I discovered your site by chance, and I am shocked why this accident didn't happened earlier! I bookmarked it. http://cialllis.com/

  48. This design is spectacular! You most certainly know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost...HaHa!) Wonderful job. I really loved what you had to say, and more than that, how you presented it. Too cool! https://hhydroxychloroquine.com/

  49. Thank you for another magnificent article. Where else may just anyone get that kind of info in such a perfect means of writing? I have a presentation next week, and I'm at the search for such info. https://tadalafil.cleckleyfloors.com/

  50. We're a gaggle of volunteers and starting a brand new scheme in our community. Your web site offered us with helpful information to work on. You've done an impressive process and our entire community might be thankful to you. http://cavalrymenforromney.com/

  51. generic cialis online acheter cialis en france prix cialis 5mg cpr 28 ou acheter du cialis pas cher

  52. composition du cialis cialis generique livraison express cialis sans ordonnance en pharmacie en france pourquoi cialis ne marche pas

  53. What's up to every body, it's my first go to see of this weblog; this webpage contains remarkable and really excellent material designed for visitors. http://vidalista.buszcentrum.com/

  54. viagra ou autre viagra en ligne sans ordonnance maman donne du viagra à son fils pourquoi les hommes prennent du viagra

  55. pharmacie viagra viagra en ligne combien coute une boite de viagra ou acheter du vrai viagra sur internet

  56. You made some good points there. I looked on the net to learn more about the issue and found most people will go along with your views on this site. http://antiibioticsland.com/Doxycycline.htm

  57. cialis online price comparison https://tadalafili.com/

  58. Pretty great post. I just stumbled upon your blog and wanted to mention that I have really loved surfing around your blog posts. In any case I'll be subscribing in your feed and I am hoping you write once more soon! http://cleckleyfloors.com/

  59. cialis jelly cialis paypal prezzo cialis 10 mg originale dopo quanto agisce cialis

  60. viagra cialis cialis 5 mg 14 compresse prezzo in farmacia cialis 5 mg durata trattamento dove trovare cialis a pesaro

  61. viagra cialis viagra 25 viagra senza ricetta medica in italia come creare un viagra fatto in casa

  62. viagra acquisto online dove acquistare viagra originale on line ci vuole la ricetta per il viagra aspirina funziona come il viagra

  63. efectos cialis cialis 24 horas precios de viagra cialis y levitra que es el cialis y para que sirve

  64. foros de cialis cialis professional cialis once a day comprar farmacia on line cialis

  65. viagra generique comprar viagra generico barato india donde comprar viagra en gibraltar como hacer viagra casero

  66. broma viagra logan viagra gibraltar algo parecido a la viagra pero natural que pastilla de viagra es mejor

  67. Thank you for the auspicious writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! By the way, how can we communicate? https://atadalafil.online/

  68. Hey there! I've been following your blog for a while now and finally got the courage to go ahead and give you a shout out from Humble Texas! Just wanted to mention keep up the good job! http://ciaalis2u.com/

  69. fantastic submit, very informative. I wonder why the opposite specialists of this sector don't notice this. You must continue your writing. I'm sure, you've a great readers' base already! http://canadiandrugstorerx.com/antibiotics/amoxil.html

Leave a Reply