LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Squid problem (https://www.linuxquestions.org/questions/linux-server-73/squid-problem-660383/)

rahilmaknojia 08-11-2008 07:58 PM

Quote:

Originally Posted by linuxlover.chaitanya (Post 3243352)
There is nothing too difficult about it.
Create the access control lists. in http_port directive, give the option transparent.
Create the iptables firewall rules for forwarding the http requests to squid port.
This link will help you making a transparent squid. But if you make a squid work first, it will be better for you to know where you are going wrong.

http://www.cyberciti.biz/tips/linux-...uid-howto.html

Firstly, if squid is installed, create the acls and configure the squid configuration file as you need.
Then start the squid. Turn off the firewall and allow squid from SELinux. Configure the client web browser to use your squid.
Once this gets working go for making it work as transparent.



I haven't done transparent squid, but i allowed all ports from IPtables and it works, but what is the use of transparent squid I tried but it doesn't work it, it say unrecognized httpd_accel ..... y this error come where I should put this setting.


thank you.

linuxlover.chaitanya 08-12-2008 12:11 AM

Squid is http proxy as well as a caching package. You can use squid to filter the http content or block specific sites and for bandwidth management. Though most of the things can be done in iptables as well but squid gives you a very good and efficient way of doing it and managing your content on network. The link posted in my previous post is a good example of the transparent squid configuration though just basic. If you follow the steps in the example, there is no reason why it should not work. You might not want to apply the script that is given for transparent squid but try it without it to see if squid works.
Just for information, can you access internet on the box that is running squid?

ne pas 08-12-2008 04:50 PM

@rahilmaknojia:
Configuring a transparent proxy should not be your problem at this time.

You should solve your initial problem first.

You did get the error message "No route to host" as you tried to connect to
your server at 3128.

This indicates that something is wrong with your routing table or your
connection is blocked by filter/firewall.
You said both machines can ping each other, so your routing table should be ok.

Quick summary of information you've provided so far:
Code:

HOST:          server
IP-ADDR:        172.16.19.66

Squid is listening on 0.0.0.0:3128

HOST:          client
IP-ADDR:        172.16.19.85
NETMASK:        255.255.0.0
BROADCAST:      172.16.255.255

Trying to connect to 172.16.19.66 3128 with telnet resulting in "No route to
host" error.

To make things clear... your real machine's operating system is Linux
(172.16.19.66), which runs a squid as HTTP proxy server and a virtual
machine (172.16.19.85) with Linux as OS. What Linux distributions?

Please provide additional information (about routing tables, netfilter rules, ...), run the
following commands on both machines and post their outputs.
Code:

netstat -nr
Code:

$ iptables -vL -n
And output of ifconfig for 172.16.19.66.

Is SELinux active for one of the machines?
yes?!, what mode?

Code:

cat /etc/selinux/enforce

rahilmaknojia 08-13-2008 11:49 AM

Quote:

Originally Posted by ne pas (Post 3245225)
@rahilmaknojia:
Configuring a transparent proxy should not be your problem at this time.

You should solve your initial problem first.

You did get the error message "No route to host" as you tried to connect to
your server at 3128.

This indicates that something is wrong with your routing table or your
connection is blocked by filter/firewall.
You said both machines can ping each other, so your routing table should be ok.

Quick summary of information you've provided so far:
Code:

HOST:          server
IP-ADDR:        172.16.19.66

Squid is listening on 0.0.0.0:3128

HOST:          client
IP-ADDR:        172.16.19.85
NETMASK:        255.255.0.0
BROADCAST:      172.16.255.255

Trying to connect to 172.16.19.66 3128 with telnet resulting in "No route to
host" error.

To make things clear... your real machine's operating system is Linux
(172.16.19.66), which runs a squid as HTTP proxy server and a virtual
machine (172.16.19.85) with Linux as OS. What Linux distributions?

Please provide additional information (about routing tables, netfilter rules, ...), run the
following commands on both machines and post their outputs.
Code:

netstat -nr
Code:

$ iptables -vL -n
And output of ifconfig for 172.16.19.66.

Is SELinux active for one of the machines?
yes?!, what mode?

Code:

cat /etc/selinux/enforce



I have allowed all ports from IPtables and its work, but i dont wanna do like this like allowing all ports from iptables I just wanna allow only squid service to access all client PC not all ports.

here is the output of my iptable list


[root@rahil ~]# iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@rahil ~]#

I will try transparent squid and let you know problem.


And thankz for reply from you and all friendz who helped me.

rahilmaknojia 08-16-2008 05:24 AM

transparent squid problem
 
Hello,

I have configure transparent squid but its working problem I get is when I try squid -z i get error below

[root@rahil ~]# squid -z
2008/08/16 15:53:22| parseConfigFile: line 2938 unrecognized: 'httpd_accel_host virtual'
2008/08/16 15:53:22| parseConfigFile: line 2939 unrecognized: 'httpd_accel_port 80'
2008/08/16 15:53:22| parseConfigFile: line 2940 unrecognized: 'httpd_accel_with_proxy on'
2008/08/16 15:53:22| parseConfigFile: line 2941 unrecognized: 'httpd_accel_uses_host_header on'

'httpd_accel_host virtual'
'httpd_accel_port 80'
'httpd_accel_with_proxy on'
'httpd_accel_uses_host_header on' (where should I put this following line).

Well what is the different between normal squid and transparent squid.
I am confuse.

rahilmaknojia 08-17-2008 10:32 AM

Quote:

Originally Posted by rahilmaknojia (Post 3249496)
Hello,

I have configure transparent squid but its working problem I get is when I try squid -z i get error below

[root@rahil ~]# squid -z
2008/08/16 15:53:22| parseConfigFile: line 2938 unrecognized: 'httpd_accel_host virtual'
2008/08/16 15:53:22| parseConfigFile: line 2939 unrecognized: 'httpd_accel_port 80'
2008/08/16 15:53:22| parseConfigFile: line 2940 unrecognized: 'httpd_accel_with_proxy on'
2008/08/16 15:53:22| parseConfigFile: line 2941 unrecognized: 'httpd_accel_uses_host_header on'

'httpd_accel_host virtual'
'httpd_accel_port 80'
'httpd_accel_with_proxy on'
'httpd_accel_uses_host_header on' (where should I put this following line).

Well what is the different between normal squid and transparent squid.
I am confuse.




can any one help me with post no. 35

linuxlover.chaitanya 08-18-2008 12:39 AM

I have not seen those parameters in the latest build of squid that I am using right now. So you may want to omit those lines for now to test the functioning of your transparent squid first. Though I have not seen those parameters, you may want to wait for experts to come and comment on it.
Till then do without it.

rahilmaknojia 08-18-2008 05:25 AM

Quote:

Originally Posted by linuxlover.chaitanya (Post 3251179)
I have not seen those parameters in the latest build of squid that I am using right now. So you may want to omit those lines for now to test the functioning of your transparent squid first. Though I have not seen those parameters, you may want to wait for experts to come and comment on it.
Till then do without it.

OKay I did this becoz you gave me the link from tht i did it anyways its okay but thankz for the help.....!!!!!

linuxlover.chaitanya 08-18-2008 05:29 AM

Use the link for reference and then apply your rules without the directives and try if it works.

garyalex 08-18-2008 05:53 AM

For newer versions of squid use the following in your squid.conf:

Code:

http_port 3128 transparent
Is your proxy working now?


All times are GMT -5. The time now is 09:40 AM.