Re: 2 different routes

From: jpd (read_the_sig_at_do.not.spam.it)
Date: 10/26/04


Date: Tue, 26 Oct 2004 20:06:36 +0000 (UTC)

On 2004-10-26, Martin <nospam@example.org> wrote:
> alex@ise-spb.org wrote:
>> I have 2 REAL subnets:
>> 213.x.x.224/28 (gw = 213.x.x.225)
>> 193.y.y.176/28 (gw = 193.y.y.177)
>>
>> rl0 has adress 213.x.x.226
>> rl1 has adress 193.y.y.178
>>
[snip]
>> is it possible to make it accessable by 2 ip at the time?
>
> You want something like:
>
> route add -net 193.y.y.176/28 193.y.y.177
>
> though I've probably got the syntax wrong. Get that working by hand, then
> look into making it work automatically at boot-up via /etc/rc.conf .

What's more important; you're trying to route a subnet you're in through
its gateway -- that won't work the way you expect it to. The route
for the subnet is fine, it'll be added automatically as soon as you
do ifconfig rl1 193.y.y.178/28. (ifconfig adds that route, see the
manpage.)

What you'd need for the above setup to work for the rest of the world
is FreeBSD keeping state and doing source-based routing. By itself its
route table doesn't support that, AFAIK. One could try and use NAT
or build a firewall ruleset that will toss off return packets to the
gateway of the secondary public network for things that came in on that
interface.

Maybe someone better versed in ipf/ipfw/pf and/or natd can tell if this
can be done. I think that at least with NAT you can do _something_, even
if you have to hide things for your applications (and that will be a
drawback for eg http servers). I think that otherwise OP is looking at
hacking the routing mechanism in FreeBSD itself.

This is different from two gateways on one subnet (which solaris seems
to support in a round-robin way) in the obvious way. Note that the
windows routing stuff does support multiple gateways on multiple subnets
but it will toss packets to either of them indisciminately. (Very useful
in making the users think that the network is INCREDIBLY S L O W, that
with an effective packet loss of 50% or more, if one of the networks
happens to be private not routed.)

-- 
  j p d (at) d s b (dot) t u d e l f t (dot) n l .


Relevant Pages

  • Re: [SLE] connection redundancy
    ... which is the router just this side of the ... >>because it's own gateway is still up. ... You'll also need three network cards to put into this Linux box. ... your internal LAN can route packets to the Internet. ...
    (SuSE)
  • Re: AIX 1.3 Failures and Fables
    ... DESTINATION GATEWAY FLGS REFCNT USE INTERFACE ... Is my interpretation of the AIX 1.3 #man route correct? ... Manually manipulates the routing tables. ... Is the destination host or network. ...
    (comp.sys.ibm.ps2.hardware)
  • Re: AIX 1.3 Failures and Fables
    ... I don't know if 1.3 has SMIT or its equivalent but there should be some way to add a default gateway which is your router. ... Is my interpretation of the AIX 1.3 #man route correct? ... Manually manipulates the routing tables. ... Is the destination host or network. ...
    (comp.sys.ibm.ps2.hardware)
  • Re: Event ID 1000 (Userenv) Error and Event ID 8021 (BROWSER) Error
    ... > destination route entry with the 192.168.0.1 GWY was higher priority, ... > the external network), and from there to the open Internet. ... > An additional item is that it appears that if any of the NICs in the ... > with destination addresses on the 192.168.1 subnet to get to the ...
    (microsoft.public.win2000.dns)
  • Re: Event ID 1000 (Userenv) Error and Event ID 8021 (BROWSER) Error
    ... > destination route entry with the 192.168.0.1 GWY was higher priority, ... > the external network), and from there to the open Internet. ... > An additional item is that it appears that if any of the NICs in the ... > with destination addresses on the 192.168.1 subnet to get to the ...
    (microsoft.public.win2000.networking)