Hi Moris,
A quick look over this and the problem is that you have two default
gateways. I run a setup close to this (we have 3 default gateways) and
without routing it using rt_tables and the likes you won't have any luck.
Do a "tcpdump" of the interfaces while requesting traffic and you will see
what I mean, the packet will go out with the right source address, but the
wrong interface.
If you need to setup the rest, contact me off list and we can see if my
script will do it.
Cheers,
Pieter
On Tue, 20 Apr 2010, Moris Diu wrote:
Amos Jeffries 提到:
> EIN SA wrote:
>> Hello all,
>> I am looking for a solution to forward some specific hostname to my 2nd
>> lan card.
>> My network inferface
>> eth0 192.168.2.80 (connect Internet by a dynamic real IP)
>> eth1 192.168.11.240 (connect Internet by a fixed real IP)
>>
>> All user clients PC point to 192.168.2.80 and the default will go out
to
>> eth0. But if the user trying go to ebrary.com, I wish the routing will
>> go to the eth1.
>>
>> I have follow setting at my squid.conf but it does not work
>>
>> acl To_ebrary dstdomain .ebrary.com
>> acl From_ebrary srcdomain .ebrary.com
>> tcp_outgoing_address 192.168.11.240 To_ebrary
>> tcp_outgoing_address 192.168.11.240 From_ebrary
>
> Almost. Try this:
>
> acl To_ebrary dstdomain .ebrary.com
> tcp_outgoing_address 192.168.2.80 !To_ebrary
> tcp_outgoing_address 192.168.11.240 To_ebrary
>
> Amos
Hi Amos,
Thank you for your help and I had changed the config as your suggestion.
It still failed to route to 192.168.11.240. If type www.google.com at
IE, the traffic will go to 192.168.2.80. But type www.ebrary.com, and
the browser error message
ERROR
The requested URL could not be retrieved
--------------------------------------------------------------------------------
The following error was encountered while trying to retrieve the URL:
http://www.ebrary.com/
Connection to 140.234.254.11 failed.
Follow is my network config and there is no iptable:
/tmp# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt
Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0
eth0
192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0
eth1
0.0.0.0 192.168.2.254 0.0.0.0 UG 0 0 0
eth0
0.0.0.0 192.168.11.254 0.0.0.0 UG 0 0 0
eth1