From owner-freebsd-questions Mon Feb 12 5:25:33 2001 Delivered-To: freebsd-questions@freebsd.org Received: from tik2.ethz.ch (unknown [129.132.66.10]) by hub.freebsd.org (Postfix) with ESMTP id BC37D37B401 for ; Mon, 12 Feb 2001 05:25:28 -0800 (PST) Received: from kom25.ethz.ch (kom25 [129.132.66.3]) by tik2.ethz.ch (8.8.8/8.8.8) with ESMTP id OAA07754; Mon, 12 Feb 2001 14:24:06 +0100 (MET) Received: from localhost (flury@localhost) by kom25.ethz.ch (8.8.8/8.8.8) with ESMTP id OAA06504; Mon, 12 Feb 2001 14:24:03 +0100 (MET) X-Authentication-Warning: kom25.ethz.ch: flury owned process doing -bs Date: Mon, 12 Feb 2001 14:24:03 +0100 (MET) From: Placi Flury X-Sender: flury@kom25 To: Nick Rogness Cc: freebsd-questions@FreeBSD.ORG Subject: Re: static routing (Freebsd 4.2) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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