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 - 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 09-16-2013, 03:39 PM   #1
digitania
LQ Newbie
 
Registered: Sep 2013
Posts: 1

Rep: Reputation: Disabled
Configuring squid server for caching using Arch and Meraki


Greetings all. New user, first post, need help.

I have been tasked with building a web caching solution for use in a remote field application where bandwidth is limited. The goal is to cache frequenly-accessed web pages for the 200 or so users at the event and thereby reduce pressure on our limited uplink. We use Meraki devices as our access points and filtering/throttling solution. I have chosen to use squid on a dedicated Arch Linux box built with minimal packages and my goal is to have this do nothing other than completely transparent simple caching.

Configuation will essentially be: uplink device (modem or LTE device) -> squid -> Meraki master -> clients (possibly via other Merakis in mesh).

My initial testing of this solution worked great on my home network without a Meraki. I set up bridging between the two NICs and pointed my browser to use a proxy with the address being that of the bridge device. I then moved on to introducing one of the Merakis that I have as a test unit, and I have not yet been able to get the squid server to cache properly. Note that the Merakis will use a 10.0.0.0/8 IP range while my home network uses a192.168.1.0/24 range, and I don't know for certain what IP address we'll have for our field uplink, but I hope that whatever solution I get to work will translate to that, even if I need to change a conf file or two once I find out.

After doing some research it appears that I need to change from using a bridge to using a router configuration, since I'll be bridging two separate subnets. This seems to be where I'm running into trouble. I either can't get communication through the squid box to the Internet, or if I do get communication there is no activity in squid and no caching is occuring.

My squid.conf is essentially unmodified. I've tried using transparent and intercept arguments on the squid port line (still using 3128) and neither seem to have any effect. I'm allowing access to 10.0.0.0/8. I can't seem to add a proxy server to the Meraki configuration to be passed to the clients when they get their DHCP leases.

I set up routing using this example:

Code:
# gid=`id -g proxy`
# iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --gid-owner $gid -j ACCEPT
# iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination SQUIDIP:3128
# iptables-save > /etc/iptables/iptables.rules
I've tried using the uplink and downlink addresses for SQUIDIP -- this is one issue; I'm not clear on which address I need to point to here..

I had originally set up my bridge thusly:

Code:
 ifconfig eth0 0.0.0.0 promisc up
ifconfig eth1 0.0.0.0 promisc up

brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1

ifconfig br0 192.168.1.200 netmask 255.255.255.0 up
route add default gw 192.168.1.1 dev br0
and it worked great as long as client IP was in same subnet and browser pointed to 192.168.1.200 as a proxy.

I have about a week to figure this out and get it ready to implement. Any help will be most welcomed and appreciated. Thanks in advance.
 
Old 09-18-2013, 02:19 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
You should definetly go the routing way and not bridging things.
Check your iptables script, maybe check the man page and see what the -j option in with the ACCEPT target does. Also check the direction your using.

As I understood you you want all the HTTP traffic (take port 80 for instance) from the local network to go through your proxy. So incoming on port 80 redirect to localhost port 3128. Squid should do the rest and call out to the www.
 
  


Reply



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 server not caching anything anis123 Linux - Newbie 4 05-02-2012 12:58 AM
squid server not caching site anis123 Linux - Newbie 1 04-28-2012 11:08 PM
Browser Cache vs Caching Server (Squid) phpinfo Linux - Networking 2 12-15-2009 03:49 AM
single ip bypass squid caching server banker_09 Linux - Newbie 2 02-27-2009 09:13 AM
LXer: Installing/Configuring/Caching Django on your Linux server LXer Syndicated Linux News 0 06-05-2008 03:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:33 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