LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 08-14-2008, 03:33 PM   #1
kas2008
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Rep: Reputation: 0
How do you configure squid as a transparent proxy in Fedora Core 9?


How do you configure squid as a transparent proxy in Fedora Core 9?

I got 2 NICs:
NIC 1 = 192.168.0.80 - connected to LAN, default gateway is the other NIC
NIC 2 = 192.168.0.81 - connected to router to internet

I followed the instructions online (Can't post the URL because I'm new)


The following lines doesn't work:
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

I replaced them with:
http_port 80 transparent



My client is a Windows XP with the following configurations:
IP Address: 192.168.1.29
Subnet Mask: 255.255.0.0
Default Gateway: 192.168.0.80

Whenever I go to a website I get a:

ERROR

The requested URL could not be retrieved
----------------------------------------
While trying to retrieve the URL: /
...
...
...

Your cache administrator is root.



I have spent a lot of time on this already and I don't know what else to do.

Please help.
 
Old 08-14-2008, 04:59 PM   #2
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I don't see how you windows machine on 192.168.1 subnet is meant to talk to your server on 192.168.0 subnet. I assume you can't ping from the windows machine to 192.168.0.80

Change the internal IP on the server to 192.168.1.80 or similar, and change the default gateway on the windows machine to this IP. Then try to ping it.

What are the nameserver settings on the windows box?

Post the howto link (you can now) and also full error messages, not sanitised versions.

Last edited by billymayday; 08-14-2008 at 05:00 PM.
 
Old 08-15-2008, 07:14 AM   #3
kas2008
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Original Poster
Rep: Reputation: 0
I can ping the 192.168.0.80 from the XP box because our network uses the /16 subnet. We place all our servers and other static IPs in the 192.168.0.0 network and another office that's using 192.168.3.0 but our main LAN uses 192.168.1.0.

Our DNS server has the 192.168.0.251 IP Address and that's what I put on both the XP and linux boxes.

This is the website that I followed:

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



And this is the error message that I got:

ERROR The requested URL could not be retrieved
---------------------------------------------------------------------
While trying to retrieve the URL: /

The following error was encountered:

- Invalid URL

Some aspect of the requested URL is incorrect. Possible problems:

- Missing or incorrect access protocol (should be 'http://" or similar)
- Missing hostname
- Illegal double-escape in the URL-path
- Illegal character in hostname; underscores are not allowed

Your cache administrator is root.
----------------------------------------------------------------------
Generated Thu, 14 Aug 2008 GMT by name.xxx.xxx (squid/3.0.STABLE7)



I get that error message whenever I try to go anywhere online.

I tried:
www.nba.com
www.cnn.com
www.yahoo.com
www.google.com



All of them got the same error message.

Last edited by kas2008; 08-15-2008 at 07:19 AM. Reason: typo on ips
 
Old 08-15-2008, 04:02 PM   #4
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What happens if you try and ping one of those sites from Windows?
 
Old 08-18-2008, 09:07 AM   #5
kas2008
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Original Poster
Rep: Reputation: 0
When I pinged www.yahoo.com I got this:

Reply from 192.168.0.81: Destination host unreachable.
Reply from 192.168.0.81: Destination host unreachable.
Reply from 192.168.0.81: Destination host unreachable.
Reply from 192.168.0.81: Destination host unreachable.
 
Old 08-18-2008, 09:09 AM   #6
kas2008
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Original Poster
Rep: Reputation: 0
This is what I have on my iptables



# Generated by iptables-save v1.4.0 on Thu Aug 14 10:39:33 2008
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i eth0 -j ACCEPT
-A INPUT -j LOG
-A INPUT -j DROP
-A FORWARD -i eth0 -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -o eth0 -j ACCEPT
COMMIT
# Completed on Thu Aug 14 10:39:33 2008
# Generated by iptables-save v1.4.0 on Thu Aug 14 10:39:33 2008
*nat
:PREROUTING ACCEPT [2407:636475]
:POSTROUTING ACCEPT [163:11688]
:OUTPUT ACCEPT [166:12343]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.0.81:3128
-A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
-A POSTROUTING -o eth1 -j MASQUERADE
COMMIT
# Completed on Thu Aug 14 10:39:33 2008
# Generated by iptables-save v1.4.0 on Thu Aug 14 10:39:33 2008
*mangle
:PREROUTING ACCEPT [250917:19060543]
:INPUT ACCEPT [250908:19056021]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [375079:480374935]
:POSTROUTING ACCEPT [375088:480379457]
COMMIT
# Completed on Thu Aug 14 10:39:33 2008
 
Old 08-18-2008, 09:12 AM   #7
kas2008
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Original Poster
Rep: Reputation: 0
And this is what's on the squid.conf



acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow localhost
http_access deny all
icp_access allow localnet
icp_access deny all
htcp_access allow localnet
htcp_access deny all
http_port 3128
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern (cgi-bin|\?) 0 0% 0
refresh_pattern . 0 20% 4320
http_port 192.168.0.81:80 transparent
http_port 127.0.0.1:80 transparent
acl lan src 192.168.0.81 192.168.1.0/24
http_access allow localhost
http_access allow lan
icp_port 3130
coredump_dir /var/spool/squid
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Squid Transparent Proxy SBN Linux - Server 6 07-11-2007 03:54 AM
proxy server setup with squid on fedora core 3 Jabber Linux - Networking 1 10-27-2005 02:31 AM
Squid as a transparent proxy kemplej Linux - Software 2 12-08-2004 05:00 PM
Squid Transparent Proxy 1jamie Linux - Security 7 09-26-2003 06:09 AM
squid transparent proxy...... hitesh_linux Linux - Networking 1 06-13-2003 03:24 AM


All times are GMT -5. The time now is 12:15 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration