From owner-freebsd-net@FreeBSD.ORG Tue May 26 12:46:01 2009 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D6071065670 for ; Tue, 26 May 2009 12:46:01 +0000 (UTC) (envelope-from robert@blacquiere.nl) Received: from mail.blacquiere.nl (mail.blacquiere.nl [78.47.62.196]) by mx1.freebsd.org (Postfix) with ESMTP id D17A88FC18 for ; Tue, 26 May 2009 12:45:59 +0000 (UTC) (envelope-from robert@blacquiere.nl) Received: from [192.168.201.4] (helo=shell.blacquiere.nl ident=robert) by mail.blacquiere.nl with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1M8vR0-0008fT-3S; Tue, 26 May 2009 14:07:10 +0200 Date: Tue, 26 May 2009 14:07:09 +0200 From: Robert Blacquiere To: FreeBSD Net Message-ID: <20090526120709.GI17104@macmini.blacquiere.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Disclaimer: running FreeBSD User-Agent: Mutt/1.5.18 (2008-05-17) X-SA-Exim-Connect-IP: 192.168.201.4 X-SA-Exim-Mail-From: robert@blacquiere.nl X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail.blacquiere.nl X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.2.4 X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on mail.blacquiere.nl) Cc: Subject: Using multiple routing tables and rc.conf X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2009 12:46:01 -0000 Hi, I'me testing a network setup using multiple routing tables. I want to use this to setup different gateways. Some basic design is this: The system has two different uplinks (fast and slow for backup). And somewhere on the internet a colo with a full internet address range. I have setup the system with 2 giftunnels and use ospf over these for the internet range. This seems to be working. I want this to be configured with settings in rc.conf but failed to find the magic to do things like: setfib 0 ifconfig gif0 create 172.16.0.1 172.16.0.2 netmask 255.255.255.255 tunnel $extern_fast $colo I know setfib is not needed for the default routing table. setfib 1 ifconfig gif1 create 172.16.0.3 172.16.0.4 netmask 255.255.255.255 tunnel $extern_slow $colo and the routes: route add default $gateway_fast setfib 1 route add default $gateway_slow and use a third routing table for the ospf routing and pf to route traffic using the ospf announced routes. How would this be fitted in the rc.conf? for normal giftunnels i would use some thing like: gif_interfaces="gif0 gif1" gifconfig_gif0="$extern_fast $colo" ifconfig_gif0="inet 172.16.0.1 172.16.0.2 netmask 255.255.255.255" gifconfig_gif1="$extern_slow $colo" ifconfig_gif1="inet 172.16.0.3 172.16.0.4 netmask 255.255.255.255" But this won't include the setfib. For jails there is a setfib command using jail__fib. I would like some thing like that also for routes, interfaces and deamons to start. I know i could set these things in a rc.local but would rather use rc.conf for configuration. Did any of you guys done something like this? Regards Robert