LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Squid Proxy in CentOS (https://www.linuxquestions.org/questions/linux-newbie-8/squid-proxy-in-centos-882155/)

hans_bug 05-22-2011 08:44 PM

Squid Proxy in CentOS
 
hi,
i'm new to linux and i was tasked to setup a proxy server to block access to some websites.
i'm using centOS 5 and Squid 7:2.6 STABLE21-6.e15...i appended the following and tested the configuration with the supposed server i am using and the it does seem to work but now i'm wondering how i can test it with a client computer..i have 2 LAN cards and i just connected the other to one PC (can a direct connection work or does it need to pass thru a switch or hub)...i just can't figure out how it should be...please help..thanks much!

how do i configure the 2nd LAN card to use this computer as its proxy server?

linuxlover.chaitanya 05-23-2011 12:02 AM

Set the IP address to the second network interface and connect it to your local network using Switch. Use this IP address in the squid.conf file so that squid listens on this IP address for the connections. This adds a level of security as well.
Code:

http_port <Internal_Card_IP>:<port> // the port part can be optional and is defaulted to 3128
Test that internet is working fine on squid system itself. Once this is done, start the squid service.
Code:

service squid start
should do it on RHEL clones. If it does not properly start the first time, chances are cache directories are not present.
Code:

squid -z
should create them.

Configure your client browsers to use proxy server and use the above IP address and port configured in squid.conf. And now test internet connectivity.

hans_bug 05-23-2011 07:33 AM

..thanks much..
..i've tried but it still didn't work...if i use 2 NICs in 1 PC, should there be a configuration to make aside from that of the squid config?
..or can i test my squid config using 1 NIC...i mean this PC is connected to a switch so can i just configure the other computers to use this as proxy???

scream 05-23-2011 07:39 AM

how internet is connected with your proxy server?

linuxlover.chaitanya 05-23-2011 11:35 AM

Your squid probably should have two network cards. This is the way proxy should work. There should be no configuration apart from the fact that the two network interfaces should be assigned IP addresses in different networks. Also, how is your internet connected to proxy?
Also, what are the errors? Just saying does not work says nothing to us. And means nothing. Try and give more information on the errors from the log files.

hans_bug 05-24-2011 12:59 AM

hi, thanks..its working now..it was just a problem with the IP addresses assigned..
thanks much again!

linuxlover.chaitanya 05-24-2011 01:14 AM

Good to know. You are welcome.

hans_bug 05-25-2011 08:30 PM

hello again...
i have encountered my first issue with using squid proxy, i cannot download files from FTP servers.
please help..thanks much!

the error looks like this:
use PORT of PASV

and the other is:
* Read Error

The system returned:

(104) Connection reset by peer

An error condition occurred while reading data from the network. Please retry your request.

and the other is this:

hans_bug 05-31-2011 08:03 PM

hello again...
i have encountered my first issue with using squid proxy, i cannot download files from FTP servers.
please help..thanks much!

the error looks like this:
use PORT of PASV

and the other is:
* Read Error

The system returned:

(104) Connection reset by peer

An error condition occurred while reading data from the network. Please retry your request.

and the other is this:


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