From owner-freebsd-questions Fri Sep 19 00:12:30 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA20238 for questions-outgoing; Fri, 19 Sep 1997 00:12:30 -0700 (PDT) Received: from ot.stpn.soft.net (freebie.opentech.stpn.soft.net [204.143.126.74]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id AAA20232 for ; Fri, 19 Sep 1997 00:12:19 -0700 (PDT) Received: from andes (andes.opentech.stpn.soft.net [204.143.126.66]) by ot.stpn.soft.net (8.6.12/8.6.12) with ESMTP id MAA27211; Fri, 19 Sep 1997 12:41:30 +0530 Message-ID: <3422B7F1.BB478976@opentech.stpn.soft.net> Date: Fri, 19 Sep 1997 12:35:45 -0500 From: Prashant Dongre Reply-To: pdongre@opentech.stpn.soft.net X-Mailer: Mozilla 4.01 [en] (WinNT; I) MIME-Version: 1.0 To: Greg Lehey CC: Alex Weeks , "'freebsd-questions@freebsd.org'" Subject: Re: I don't understand static routes afterall X-Priority: 3 (Normal) References: <01BCC41C.F85A7F20@cutthroat> <19970919105318.48856@lemis.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Greg Lehey wrote: > On Thu, Sep 18, 1997 at 10:23:54AM -0500, Alex Weeks wrote: > > Well, just about the time I thought I new what I was doing I encountered > > the following. If anyone feels like explaining what's going on I would be > > interested. > > > > I have three subnets. I have a FreeBSD machine routing between subnet a > > and subnet b and another FreeBSD machine routing between subnet b and > > subnet c. The is necessary because the physical setup prevents one machine > > from connecting to all three subnets. Let's call the machine that sits > > between a and b machine A and the machine that sits between b an c machine > > B. > > > > In order to get subnet a to talk with subnet c I needed to include a static > > route in A. The static route should say something like "route all traffic > > for subnet c through on subnet b" where physically > > resides in machine B. > > > > Let me put numbers to it. > > Subnet a is 192.1.1.0 > > Subnet b is 192.1.2.0 > > Subnet c is 192.1.3.0 > > > > I should have been able to accomplish the above with "route add -net > > 192.1.3.0 -interface 192.1.2.1" assuming 192.1.2.1 is the 192.1.2.0 > > interface in machine B. > > > > But this didn't work. What's wierd however is that it did work to enter > > each hostname in invididually! I litterally typed > > route add 192.1.3.1 192.1.2.1 > > route add 192.1.3.2 192.1.2.1 > > route add 192.1.3.3 192 1.2.1 > > etc....... for the entire subnet. Now it's working fine. > > > > Have I made a glaring error? Do I completely misunderstand subnets and > > routing? > > It would be nice to see the output of netstat -r and possible netstat > -a. > > Greg > > > In real life these are 27 bit class c subnets but that shouldn't matter for > > the example. I did include a "-netmask" statement in real life but it > > wouldn't make sense for this example. > > Just possibly it would. I've seen some bugs in this area when the > tables get big. > > Greg Hi, I faced the same problem when started using FreeBSD as router 2 years back. Just do not run routed. Add static routing entries in gated.conf in /etc like this. static { 192.168.1.0 mask 255.255.255.0 interface ix0 preference 150 ; } ; Prashant.