Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Feb 2001 14:24:03 +0100 (MET)
From:      Placi Flury <flury@tik.ee.ethz.ch>
To:        Nick Rogness <nick@rogness.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: static routing (Freebsd 4.2)
Message-ID:  <Pine.GSO.4.21.0102121333130.6445-100000@kom25>
In-Reply-To: <Pine.BSF.4.21.0102091034260.55998-100000@cody.jharris.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Hello,

> > I'm trying to set up static routes within a subnet (for some tests). The
> > net-topology looks like:
> > 
> > 	HA2<------>RA<------->RB<----BA2
> > 		    \        /	
> > 		     \      /	
> > 	              ->RC<-
> > 			 |
> >                      |(Interface xl2)
> > 			
> > where RA, RB and RC are the routers. I started to define my routing
> > table with 'route'. On router RC the result looks like:
> > 
> > Destination    Gateway           Flags  Refs  Use  Netif Expire
> > localhost     localhost           UH     0    0    lo0     	
> >  RB_RC      0:50:da:47:43:67     UHLS    1    0    xl1
> >  HA2	      RB_RC	     UGHS    0    0    xl2
> >    .... 	
> > 
> > The queer (and wrong) thing happens when I define that the route to
'HA2'
> > has to use the gateway RB_RC (which is the interface of router RB to
> > router RC), since packets with destination HA2 are sent to interface xl2, 
> > which points somewhere in Nirwana (to another subnet). 
> > 
> 
> 	Why is the route for H2 already pointing out xl2?  WHat is your
> 	IP addressing scheme?

The interfaces of router RC are: RC->RA on xl0, 
			 	 RC->RB on xl1,
				 RC->...on xl2 (to another subnet)

The subnet in which HA2, RA, RB and RC are, is 129.132.57.32/32. 
My intention consists in defining eplicitely the routes packets have to
use (e.g. traffic from HA2 should take the longer way to reach BA2,
i.e. route HA2->RA-->RC-->RB->BA2, but traffic from BA2 to HA2 the
shorter,i.e. route  BA2->RB->RA->HA2). For these purpose I first deleted
the routing tables and started to set up static routes. The problem I got
was, that FreeBSD assigned different (wrong) netinterfaces to the routes,
e.g. at Router RC (suppose only the localhost route is defined
yet (first entry in routing table above)) I typed the following commands
to add route RB_RC:
	
	> route add -host RB_RC -iface xl1  # add route RB_RC (ok)
	> arp -s RB_RC  0:50:da:47:43:67    # set correct MAC-address
       
This worked properly and is as I suppose correct (cf. routing table
above second entry). Next I tried to specify the route packets from RC
have to take, when the destination is HA2. I defined, that they have to
take route: RC->RB->RA->HA2. So I entered following command (on RC):

	> route add -host HA2 RB_RC   # the gateway is thus router RB
	
The resulting entry in the routing table is shown above (third entry). As
one can see, the FreeBSD assigned the netinterface "xl2" to the route,
which is wrong, since the route to RB_RC needs to use the netinterface
"xl1". Furthermore it would also be wrong to explicitely define the route
by typing:

	> route add -host HA2 -iface xl1 

what would mean that HA2 is directly accessible.


> > To my questions: how can I explicitely force freebsd to avoid to
> >assign a netinterface (Netif) to route HA2 when the gateway (with a
> >differen Netif) is already defined in the routing table? 
> >Or is there any  way to change the netinterface without modifying the
route?     
> > 
> 
> 	I don't know what you are trying to do with the details you
> 	provided.  Does HA2 reside on a directly connected interface as
> 	well as hanging off the RA network.

I'm not sure if I understand your question correctly. HA2 has only one
interface with which it is directly connected to router RA (as said, they 
are in the same subnet).  


thank you very much for the interest,

Placi



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.21.0102121333130.6445-100000>