From owner-freebsd-isp@FreeBSD.ORG Wed Aug 22 14:35:14 2007 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D33A16A417 for ; Wed, 22 Aug 2007 14:35:14 +0000 (UTC) (envelope-from ssch@wheel.dk) Received: from freesbee.wheel.dk (freesbee.wheel.dk [IPv6:2001:6c8:1:1000::5]) by mx1.freebsd.org (Postfix) with ESMTP id 16AD813C45B for ; Wed, 22 Aug 2007 14:35:14 +0000 (UTC) (envelope-from ssch@wheel.dk) Received: by freesbee.wheel.dk (Postfix, from userid 1011) id 1F6DD2E426; Wed, 22 Aug 2007 16:35:13 +0200 (CEST) Date: Wed, 22 Aug 2007 16:35:13 +0200 From: Steffen Schumacher To: freebsd-isp@freebsd.org Message-ID: <20070822143513.GB66643@schumacher.dk> Mail-Followup-To: freebsd-isp@freebsd.org References: <20070822080112.GA58627@schumacher.dk> <46CC1E6E.9080701@tomjudge.com> <20070822125432.GB58627@schumacher.dk> <20070822133241.GB83613@tcbug.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070822133241.GB83613@tcbug.org> X-PGP-Fingerprint: 65A2 111C D142 3A62 8E62 8C9A 3EF2 E98F 8700 F50D X-PGP-Public-Key: http://schumacher.wheel.dk/publickey.pub X-Operating-System: FreeBSD/i386 6.2-STABLE User-Agent: Mutt/1.5.16 (2007-06-09) Subject: Re: Using FreeBSD as a router X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2007 14:35:14 -0000 On 22.08.2007 08:32:41 -0500, Josh Paetzel wrote: > Steffen Schumacher wrote: > > On 22.08.2007 12:30:54 +0100, Tom Judge wrote: > > > Steffen Schumacher wrote: > > > [cut..] > > /Steffen > > "You keep using that word. I do not think it means what you think it > means." > > In FreeBSD the default route is a directly connected host that it can > send packets to that it doesn't have a specific route to. It's not > going to 'figure out' a default route from a network address. > Ok, I'll try to elaborate what it is I'd like: For each route a 'router' must have some next-hop information, so that it knows how to forward traffic for that prefix. Typically the interface, and possibly a layer2 address (mac for ethernet) if such exist. Normally (virtually all the time) static routes are directed at connected hosts, just as you explain. This way it is simple to get the next-hop info, because it is the same as for that connected host. What I would like is for the router to realize the configured next-hop isn't a directly connected host, and as a result attempt to lookup that host to see if we have a route for the next-hop address. If we do, then we use the next-hop information from this second lookup and use the next-hop information for the original route. This is what I mean with recursive route lookups. 1. normal lookup 0/0 -> x. x/30 -> fxp0. => 0/0 -> mac of x via fxp0. 2. recursive lookup 0/0 -> y. y/16 -> x/30. x/30 -> fxp0. => 0/0 -> mac of x via fxp0. Hope this clarifies, but it does seem there is very little support for this. Does anyone know the whereabouts of this in the FreeBSD code? /Steffen > There are a lot of hacks people use to get around this, some of the > are of the 'ping this ip periodically and if it goes away swap the > default route' nature. > > You could also investigate running CARP/HSRP/VRRP/GLBP on these two gateways > so they can sit on the same IP, thus obliviating the need to change > the default route at all. > > I've never actually tried getting FBSD to grap it's own routing > information from a routing protocol but it's possible you could go > down that route as well... > > -- > Thanks, > > Josh Paetzel