LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Squid+2 Networks+2 Gateways+same Machine?! (https://www.linuxquestions.org/questions/linux-networking-3/squid-2-networks-2-gateways-same-machine-354934/)

pin_bk 08-19-2005 01:39 PM

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

peter_robb 08-19-2005 07:01 PM

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

pin_bk 08-26-2005 08:27 PM

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

pin_bk 08-27-2005 12:23 PM

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

pin_bk 08-27-2005 01:21 PM

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

pin_bk 08-29-2005 06:50 AM

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

pin_bk 09-03-2005 03:22 PM

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 07:52 PM.