LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-04-2008, 03:11 AM   #1
dmode
LQ Newbie
 
Registered: Dec 2008
Posts: 8

Rep: Reputation: 0
Squid selecting slower internet connection


Hi,

I have two internet connections on my server:

eth1 - ASDL - dynamic ip - fast
eth2 - FR - fixed ip - slow

The prob is that when the server restarts the faster connection is used and after some time the connection is dropped to the slower one?!? Seems that the whole server switches to the slower internet connection.

Where should I configure squid.conf to use exclusively the faster connection?

Thanks!

Last edited by dmode; 12-04-2008 at 03:34 AM.
 
Old 12-04-2008, 08:28 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,654
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
Wink

Hi and welcome to LQ

I think what you need to do is done in iptables.

By naming the interfaces, int_if ext_if etcetera (etc).

iptables snippet...
Code:
# Environment variables, change these values accordingly

	EXT_IF=ppp0
	INT_IF=eth0  #(you might add or change these)
	INT_NET=192.168.0.0/24


..........(heaps of lines omitted for clarity)
#
## -- Transparent proxy to Squid --- ##
#

	$IPTABLES -t nat -A PREROUTING -i $INT_IF -p tcp --dport 80 -j REDIRECT --to-port 3128
This way squid just keeps working, and the firewall does the traffic directions.
 
Old 12-04-2008, 10:27 PM   #3
dmode
LQ Newbie
 
Registered: Dec 2008
Posts: 8

Original Poster
Rep: Reputation: 0
I already have added the same thing in iptables (see line 2):

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to $eth0:3128
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128

eth0 - LAN
eth1 - ADSL - $eth0
eth2 - FR

Question: I've got this config from a forum, what's the use of the first line? Can I remove it?

Thanks!

Last edited by dmode; 12-04-2008 at 10:28 PM.
 
Old 12-04-2008, 10:52 PM   #4
dmode
LQ Newbie
 
Registered: Dec 2008
Posts: 8

Original Poster
Rep: Reputation: 0
Hey hang on! Nowhere in your code the source is clearly defined?!?

I mean in my case connectivity should be:

eth1-> squid (tranparent) -> eth0

Help!
 
Old 12-05-2008, 03:00 AM   #5
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,654
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
Use the # key to remark or comment out a line of code, it's easier to
change it than delete it. Any line starting with a # wont be read.

The device eth0 must exist using the same name.

Quote:
eth0 - LAN
this will be the input to squid proxy cache.

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128

ppp0 is my modem and where the proxy accesses the web.
Code:
(My computer and Home-Net)-> eth0 ->
                              |      -> firewall -> ppp0 -> www
                            squid ->
So this gateway (eth0 and ppp0) uses the proxy cache as well as any computers connected to my home network(eth0).

Hope this helps.

Last edited by GlennsPref; 12-05-2008 at 03:18 AM. Reason: Use commenting when editing
 
  


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
My cable internet connection seems slower than dial up!!! Southpaw76 *BSD 1 07-23-2006 09:47 PM
Slower Internet Connection jp_css Linux - Newbie 4 03-13-2005 09:22 PM
Linux Internet connection slower than with windoze. duffboygrim Linux - General 9 06-14-2004 04:52 PM
Internet connection becomes slower and slower. caesius_01 Linux - General 1 03-14-2004 02:59 PM
Slower connection to Internet after SuSE FW atari_ckx Linux - Networking 1 02-04-2004 02:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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