LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-19-2005, 12:39 PM   #1
pin_bk
Member
 
Registered: Jan 2004
Posts: 45

Rep: Reputation: 15
Squid+2 Networks+2 Gateways+same Machine?!


I have a Squid BOX with two networks - 10.40.0.0 & 10.0.0.0,

and for each network a lan card which represent their gateways.

How can these two seperate networks use the same squid and share the cache, but have different connections to the internet?

All The Best
 
Old 08-19-2005, 06:01 PM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
Have a read of the http://tldp.org/HOWTO/Adv-Routing-HOWTO
Chapters 4 & 5 detail how to split the traffic depending on it's source address
 
Old 08-26-2005, 07:27 PM   #3
pin_bk
Member
 
Registered: Jan 2004
Posts: 45

Original Poster
Rep: Reputation: 15
In that howto I found help, and by making these rules:

Code:
echo 200 T10 >> /etc/iproute2/rt_tables
echo 201 T20 >> /etc/iproute2/rt_tables
ip route add 10.40.0.0 dev eth0 src 10.40.0.169 table T10
ip route add 10.0.0.0 dev eth1 src 10.0.0.138 table T20
ip route add default via 10.40.0.10 table T10
ip route add default via 10.0.0.138 table T20
ip route add 10.40.0.0 dev eth0 src 10.40.0.169
ip route add 10.0.0.0 dev eth1 src 10.0.0.138
ip rule add from 10.40.0.169/24 table T10
ip rule add from 10.0.0.138/24 table T20
ip route flush cache
I get nothing........and If I want to have internet at all I must add a default GW using this command:

Code:
ip route add default via 10.40.0.10
or

Code:
ip route add default via 10.0.0.139
What now?

It simply uses only the default gateway, I use SuSE 9.3 Linux

Last edited by pin_bk; 08-29-2005 at 05:02 AM.
 
Old 08-27-2005, 11:23 AM   #4
pin_bk
Member
 
Registered: Jan 2004
Posts: 45

Original Poster
Rep: Reputation: 15
The diagram:

http://www.tophosting.ba/img/aos_diagram.jpg

IP ADRESSES:

SQUID BOX:
- eth0 - 10.0.0.138
- eth1 - 10.40.0.169

Linux Router:
- eth0 - 10.0.0.139 (256kbit)
- eth2 - 10.40.0.10 (256kbit)
- ETH1 - 80.65.X.X (512kbit) - PUBLIC IP ADDRESS

Last edited by pin_bk; 08-27-2005 at 12:11 PM.
 
Old 08-27-2005, 12:21 PM   #5
pin_bk
Member
 
Registered: Jan 2004
Posts: 45

Original Poster
Rep: Reputation: 15
On The Linux router, when I shutdown 10.0.0.139:

# ifdown eth0

My Pc, and the 10.40.0.0 network doesnt stop losing internet, but the 10.0.0.0 network does. In this case this routing rules work, but when both of the interfaces are up (10.0.0.139 & 10.40.0.10) the internet for the 10.40.0.0 network goes over 10.0.0.139.

HElp
 
Old 08-29-2005, 05:50 AM   #6
pin_bk
Member
 
Registered: Jan 2004
Posts: 45

Original Poster
Rep: Reputation: 15
Surfing I read that I should delete in this case, the main table, so I did and the routing rules now work.......but on the machine itself the internet is not present so the proxy does not work.....I cannot ping anything (in the shell on squid box), which is logical cuz the main table and the default route were deleted......What now?

So other protocols except the HTTP work....

p.s. updated version of the HOWRO:
http://lartc.org/howto/lartc.rpdb.multiple-links.html

Last edited by pin_bk; 08-29-2005 at 06:02 AM.
 
Old 09-03-2005, 02:22 PM   #7
pin_bk
Member
 
Registered: Jan 2004
Posts: 45

Original Poster
Rep: Reputation: 15
By the Time I spent on this problem I think that it actually is a matter of squid, because in this case it uses only the default gateway that's in the main table and dows not care for other static routes/table routing rules.

Well I will have to use two squid boxes and get thme to work together...
 
  


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.conf with different networks Ornery_Boy Linux - Networking 0 10-13-2005 11:22 AM
Two gateways? candyman123 Linux - Networking 1 09-08-2005 12:36 PM
How to have two gateways on the same linux machine at the same time deepalalla Linux - Networking 9 01-11-2005 04:51 AM
2 NICs 2 networks 2 gateways birkinshawc Linux - Networking 1 05-29-2004 03:05 PM
squid blocks the machine, how to fix it? mfeoli Linux - Newbie 3 01-09-2004 06:32 PM


All times are GMT -5. The time now is 12:14 PM.

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