General
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I determine what port my distro of Squid is configured to use for internal machines?

SOLVED
Go to solution
John Collier
Esteemed Contributor

How do I determine what port my distro of Squid is configured to use for internal machines?

I have a little firewall/router/proxy Linux distro that I'm using right now that has me a bit stumped. The truth is that I finally got brave and went from their GPL version to the latest Beta and I am finding that the Squid proxy in the Beta doesn't play the same way the one in the GPL did.

It used to be that I could simply point my web browsers at the internal IP for the router and leave the port number off completely and all was well and good. Now I have loaded the latest version and my browsers will either bypass it all together or simply can't figure out how to get through it to the 'net.

In the older version, I seem to remember that I was able to find something in the config files that told me what port they had it configured to use. I found it interesting at the time, but since I didn't need the info I simply forgot about where I found it.

Can anybody please point me in the correct direction? I can tell the browsers to bypass the proxy and they work just fine, but I would really like to get them to use this if possible.

Points will be rewarded to all who supply an honest effort.
"I expect to pass through this world but once. Any good, therefore, that I can do, or any kindness that I can show to any human being, let me do it now. Let me not defer or neglect it, for I shall not pass this way again." Stephen Krebbet, 1793-1855
5 REPLIES
Cristian Draghici
Frequent Advisor
Solution

Re: How do I determine what port my distro of Squid is configured to use for internal machines?

I'd first make sure squid is actually running on the proxy host.

ps ax | grep squid

Then i'd look for the config file:
updatedb
locate squid.conf

For me it's /etc/squid/squid.conf

The port is specified in http_port and it defaults to 3128.

Finally netstat -a should print all the ports that are being listened for connections on your machine, including the squid port.

Make sure that the ACL section in squid.conf permits access to hosts from your internal network. (I think it defaults to localhost).

Good luck,
Cristi

Stuart Browne
Honored Contributor

Re: How do I determine what port my distro of Squid is configured to use for internal machines?

Everything Christian said is great. I'll expand upon the 'netstat -a' part though.

In modern releases of Linux, the 'netstat' tool (in the 'net-tools' package) can actually map listening ports to their parent processes.

netstat -ntlp

You might find this one more useful, and less to filter through. (-l = listening, -p = process details).

It makes it easy to track down what's listening to what.

You might also want to check your firewall (iptables, yes?) to see if you have any transparent proxying in place (with a 'REDIRECT' on the '-t nat' table).

Just some thoughts.. ;)
One long-haired git at your service...
U.SivaKumar_2
Honored Contributor

Re: How do I determine what port my distro of Squid is configured to use for internal machines?

Hi,

I would do this.

#lsof -i | grep squid | grep -i listen

See the right hand corner of output. If value is

TCP *:webcache (LISTEN)

Then squid is listening in tcp port 8080.

If the value is

TCP *:squid(LISTEN)

then it is listening in tcp port 3128

If the value is

TCP *:3128(LISTEN)

Then Still squid is listening in tcp port 3128. ( But the service is not mapped to name in /etc/services )

regards,

U.SivaKumar











Innovations are made when conventions are broken
K.C. Chan
Trusted Contributor

Re: How do I determine what port my distro of Squid is configured to use for internal machines?

Make sure squid is running, then use netstat to find which port it is listenning on. To change port edit squid.conf file, http_port=; restart squid and test.
Reputation of a thousand years can be determined by the conduct of an hour
John Collier
Esteemed Contributor

Re: How do I determine what port my distro of Squid is configured to use for internal machines?

Gentlemen,

I am sorry for taking so long to respond. I meant to do so long ago, but I guess things got out of hand.

I feel obligated to award Cristi the full bunny on this one since it was the first response and it solved my query right off the bat.

I will award Stuart a partial bunny for the clarification and the expansion on the issue (yes, it is iptables). It gave me a few more things to look at and expanded my knowledge, which I truly appreciate.

U.SivaKumar,

I wish I could give you the same points that I am awarding Stuart, but my particular distribution of this package is VERY stripped down and it seems as if the commands that you suggest won't work in my particular situation. I'm sure that they are good, but since there is no way for me to verify them and they don't apply to my current situation I will just have to point as generously as I can without the bunny status.

K.C.,

While your post to this thread brought it back to my attention (which I am grateful for), all you truly did was to restate what had already been said. Since I don't believe in not awarding points and must be extremely offended or flat mad at a person to give them a 0 (zero) I will be happy to hand you a few. Consider it a reward for bringing this back to my attention.

Thanks again to all of you for your time and efforts!


Regards,
John


P.S. Cristi, could I suggest that you take the time to go back through your previous posts and assign points to those who have taken the time and effort to try to assist you with the questions that you have posted? I'm sure they would all appreciate it.

Just a thought...
"I expect to pass through this world but once. Any good, therefore, that I can do, or any kindness that I can show to any human being, let me do it now. Let me not defer or neglect it, for I shall not pass this way again." Stephen Krebbet, 1793-1855