Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-19-2005, 12:39 PM
|
#1
|
Member
Registered: Jan 2004
Posts: 45
Rep:
|
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
|
|
|
08-19-2005, 06:01 PM
|
#2
|
Senior Member
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458
Rep:
|
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
|
|
|
08-26-2005, 07:27 PM
|
#3
|
Member
Registered: Jan 2004
Posts: 45
Original Poster
Rep:
|
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.
|
|
|
08-27-2005, 11:23 AM
|
#4
|
Member
Registered: Jan 2004
Posts: 45
Original Poster
Rep:
|
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.
|
|
|
08-27-2005, 12:21 PM
|
#5
|
Member
Registered: Jan 2004
Posts: 45
Original Poster
Rep:
|
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
|
|
|
08-29-2005, 05:50 AM
|
#6
|
Member
Registered: Jan 2004
Posts: 45
Original Poster
Rep:
|
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.
|
|
|
09-03-2005, 02:22 PM
|
#7
|
Member
Registered: Jan 2004
Posts: 45
Original Poster
Rep:
|
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...
|
|
|
All times are GMT -5. The time now is 08:53 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|