From owner-freebsd-questions@FreeBSD.ORG Tue Aug 5 03:17:18 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E27E37B401 for ; Tue, 5 Aug 2003 03:17:18 -0700 (PDT) Received: from nemesis.eahd.or.ug (nemesis.eahd.or.ug [216.129.132.178]) by mx1.FreeBSD.org (Postfix) with ESMTP id A40B143F85 for ; Tue, 5 Aug 2003 03:17:08 -0700 (PDT) (envelope-from ezra@cfi.co.ug) Received: from hacker ([192.168.1.12]) by nemesis.eahd.or.ug with smtp (Exim 4.20) id 19jzL1-0002fd-A4; Tue, 05 Aug 2003 13:46:43 +0300 From: "Ezra Banoba" To: "Philip Payne" , Date: Tue, 5 Aug 2003 01:21:13 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <36D04A8168B2D41182250008C7E6F8780374F9F8@ukcamexch2.cbg.uk.corp.eu.uu.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal X-Spam-Score: -1.9 (-) X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *19jzL1-0002fd-A4*jeuSTnm4dqo* Subject: RE: backup static routes for freebsd (default) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 10:17:18 -0000 Thanks Phil, I tried some guesswork myself to add the secondary default routes router style with weights and that's the only way the route add command will accept another default route. I do not know how freebsd interpretes this: route add default [gateway] [administrative weight] though this has no effect when i birng down the default route. Maybe a script to ping the gateways at intervals will do. Any other ideas are welcome. Thanks. Ezra Banoba Systems Administrator/Programmer Computer Froniters International Plot 32 Lumumba Avenue www.cfi.co.ug +256 031260485 -----Original Message----- From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@freebsd.org]On Behalf Of Philip Payne Sent: Tuesday, August 05, 2003 2:38 AM To: 'Ezra Banoba'; freebsd-questions@freebsd.org Subject: RE: backup static routes for freebsd (default) Hi, > I have a gatway box running freebsd 4.8 and several links to > the internet > via different ISP's. > This box is connected directly to one of the ISP's but also > has access to > the other gatways via the LAN. > I would like to setup static backup (default) routes such > that when and if > the main link goes down, the default route for this box is > automatically > changed to point to another router on the LAN.I am having trouble > implementing this on freebsd. > Any ideas? First, I'm more of a router person than familiar with how FreeBSD calculates it's routing table so the following is all guesswork from "man route". The issue with static routes is that they rarely have any idea of the status of their destination but this can be fudged if you're using point-to-point interfaces e.g. DSL, leased line. In general terms what you'd be doing on a router is: 1) Have a default route directed out a point-to-point interface connected to the ISP (not the IP address) so that when the interface is down, the static route is removed from the live routing table. 2) Have a weighted default route via an alternative IP address. The weight implies this route is only used when the former default route is not available. I've read "man route" and I get the impression you can add a route via an interface rather than a destination with the switch "-interface" so your first step is to add a default route along the lines > route add default -interface ... this is a guess as the man page isn't explicit. Also, I don't know whether this route remains live or is removed as required during a failure on the point-to-point interface you'd configure this to. It definitely won't work if your primary access method is a broadcast interface e.g. ethernet. Further, I can't find any details on adding a weight to a static route to create the secondary route so I'm not sure this is going to be possible via an automatic routing table kind of thing. So.....(getting to the point very slowly) The only other method I can think of would be a script to ping the far end addresses regularly in order. Depending on which one is up, you could inject a default route statement as required to the correct destination. I'd be interested in other suggestions as this doesn't sound entirely great as there are many other reasons than link failure why an address wouldn't be pingable. Thanks, Phil. _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"