LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-29-2017, 12:30 PM   #1
sunnysthakur
Member
 
Registered: Aug 2012
Posts: 92

Rep: Reputation: Disabled
TAG_NONE/409 CONNECT - Squid 3.5.20


Hello,

I setup a squid as transparent proxy on CentOS7. I setup squid with IPtables with NAT and now if want to setup internet by setting up a proxy setting on browser from client internet is not working and i am getting "TAG_NONE/409 4347 CONNECT www.google.com:443 - HIER_NONE/- text/html" error in /var/log/squid/access.log.

But without proxy setting in browser internet is working fine. While googling in found to setup dns_v4_first on in squid.conf but still the same issue.

Can you please help me to figure out this issue.
 
Old 12-30-2017, 02:25 AM   #2
sunnysthakur
Member
 
Registered: Aug 2012
Posts: 92

Original Poster
Rep: Reputation: Disabled
I also verified that port 3128 is open on gateway.
 
Old 12-30-2017, 03:09 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Quote:
Originally Posted by sunnysthakur View Post
I also verified that port 3128 is open on gateway.
Read this for an explanation and try the suggestions in the reply.

Regards
 
Old 12-30-2017, 03:29 AM   #4
sunnysthakur
Member
 
Registered: Aug 2012
Posts: 92

Original Poster
Rep: Reputation: Disabled
@bathory :- Thanks for the reply
I went through the link but mine issue is that when i add the gateway proxy settings in browser, internet stop working for http:// as well as https:// and both have a different errors [Attached are the screenshot]. I open http://yahoo.com then it says "Access Denied" while on accessing https:// it says ERR_TUNNEL_CONNECTION_FAILED.

Below are the errors found in access.log
On Accessing https://
Local_IP TAG_NONE/409 4347 CONNECT www.google.com:443 - HIER_NONE/- text/html

On Accessing http://
171.113.249.113 TCP_DENIED/403 4219 GET http://m.search.yahoo.com/ - HIER_NONE/- text/html

However when i remove the proxy setting from browser (As squid is setup as transparent proxy as well with IPtables) then all is working fine.

And i am not using SSL_bump for my squid proxy for now.
Attached Thumbnails
Click image for larger version

Name:	Web_Proxy_Settings_2.png
Views:	604
Size:	14.0 KB
ID:	26634   Click image for larger version

Name:	Web_Proxy_Settings_3.png
Views:	556
Size:	10.2 KB
ID:	26635   Click image for larger version

Name:	Web_Proxy_Settings.png
Views:	730
Size:	17.5 KB
ID:	26636  

Last edited by sunnysthakur; 12-30-2017 at 03:31 AM.
 
Old 12-30-2017, 08:24 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Quote:
On Accessing https://
Local_IP TAG_NONE/409 4347 CONNECT www.google.com:443 - HIER_NONE/- text/html
For this you need to look again at my previous post


Quote:
On Accessing http://
171.113.249.113 TCP_DENIED/403 4219 GET http://m.search.yahoo.com/ - HIER_NONE/- text/html
The above means that there is an ACL in squid configuration file that forbids access to your client.
Without the relevant squid config directives, we cannot tell what exactly is the problem


Quote:
However when i remove the proxy setting from browser (As squid is setup as transparent proxy as well with IPtables) then all is working fine.
If you're going to setup squid as a transparent proxy, there is no need to mess with the browser settings. Outgoing traffic to port 80 is passing through the squid proxy by the iptables rules.
 
Old 01-01-2018, 12:00 AM   #6
sunnysthakur
Member
 
Registered: Aug 2012
Posts: 92

Original Poster
Rep: Reputation: Disabled
Thanks @bathory

[PHP]Without the relevant squid config directives, we cannot tell what exactly is the problem

acl our_network src 192.16.17.0/24 10.0.0.0/8 192.168.15.0/24
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT

#CONNECT use ipv4 resolution first
dns_v4_first on

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager
# 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
http_access allow our_network

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128 intercept

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 1000 16 256

#Define Cache Memory
cache_mem 1048 MB

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

#
# 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

Quote:
If you're going to setup squid as a transparent proxy, there is no need to mess with the browser settings. Outgoing traffic to port 80 is passing through the squid proxy by the iptables rules.
Reason being use this proxy setting through browser as some of client machine using tunnel (Cisco) to communicate with remote machines and internet is not setup on this tunnel. Now browser's proxy settings need to use to get internet working on these machines.
However we were using squid 2.6 before and this was working fine with same configuration and scenario.
 
Old 01-01-2018, 03:59 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Quote:
171.113.249.113 TCP_DENIED/403 4219 GET http://m.search.yahoo.com/ - HIER_NONE/- text/html
Quote:
acl our_network src 192.16.17.0/24 10.0.0.0/8 192.168.15.0/24
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
So indeed there is no 171.113.249.113 among the IPs/networks that are allowed to use squid proxy.


Quote:
Reason being use this proxy setting through browser as some of client machine using tunnel (Cisco) to communicate with remote machines and internet is not setup on this tunnel. Now browser's proxy settings need to use to get internet working on these machines.
However we were using squid 2.6 before and this was working fine with same configuration and scenario.
I don't know what was changed, but I suggest you to re-read this and see if it helps.
 
Old 01-02-2018, 06:35 AM   #8
sunnysthakur
Member
 
Registered: Aug 2012
Posts: 92

Original Poster
Rep: Reputation: Disabled
Code:
So indeed there is no 171.113.249.113 among the IPs/networks that are allowed to use squid proxy.
This is not our network IP, i don't know how it log into access.log

Code:
I don't know what was changed, but I suggest you to re-read this and see if it helps.
I will go through this link and see if it works.
 
Old 01-09-2018, 03:07 AM   #9
sunnysthakur
Member
 
Registered: Aug 2012
Posts: 92

Original Poster
Rep: Reputation: Disabled
Cool FIXED

Hello bathory,

I configured and tested the transparent proxy by modify the squid.conf and by adding below 2 lines i got this issue fixed. Rest of the SSL bump related configured get commented by me.

Quote:
http_port 0.0.0.0:3128 intercept
http_port 0.0.0.0:3130
Now when we are accessing internet using browser proxy settings it is accessible and working.

Thanks.
 
Old 01-09-2018, 04:57 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Hi sunnysthakur,

Thanks for posting the solution.
You may mark the thread "SOLVED" from the "Thread Tools" on top of the page.

Cheers
 
Old 09-20-2018, 05:25 PM   #11
antey86
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
You saved my day...
Spent 4 hours on this issue..
Thanks, guys!
 
  


Reply

Tags
proxy, squid3, transparent



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] pidgin + cisco unified presence server - reason: 6 description: 409: Conflict eantoranz Linux - Software 1 01-29-2013 02:57 PM
Howto connect SQUID box with Mikrotik and Log user’s original source ip in squid PPTP fruiz002 Linux - Networking 1 08-23-2012 06:17 AM
Howto connect SQUID box with Mikrotik and Log user’s original source ip in squid PPTP fruiz002 Linux - Networking 1 08-01-2012 02:26 AM
Squid config, allow external IP address to connect to Squid langerak Linux - Server 10 08-04-2010 09:17 AM

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

All times are GMT -5. The time now is 11:07 AM.

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