From owner-freebsd-net@FreeBSD.ORG Tue Sep 2 07:00:53 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 281EF10656C0 for ; Tue, 2 Sep 2008 07:00:53 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outU.internet-mail-service.net (outu.internet-mail-service.net [216.240.47.244]) by mx1.freebsd.org (Postfix) with ESMTP id 0DBFE8FC14 for ; Tue, 2 Sep 2008 07:00:53 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id A52472423; Tue, 2 Sep 2008 00:00:52 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 6AFE52D603A; Tue, 2 Sep 2008 00:00:51 -0700 (PDT) Message-ID: <48BCE4AA.6050807@elischer.org> Date: Tue, 02 Sep 2008 00:00:58 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: "Bruce M. Simpson" References: <3170f42f0809010507q6c37a9d5q19649bc261d7656d@mail.gmail.com> <48BBE7B2.4050409@FreeBSD.org> In-Reply-To: <48BBE7B2.4050409@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: debarshi.ray@gmail.com, FreeBSD networking and TCP/IP list Subject: Re: reading routing table 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, 02 Sep 2008 07:00:53 -0000 Bruce M. Simpson wrote: > Debarshi Ray wrote: >> ... >> I was going through the FreeBSD and NetBSD documentation and the >> FreeBSD sources of netstat and route. I was suprised to see that while >> NetBSD's route implementation has a 'show' command, FreeBSD does not >> offer any such thing. Moreover it seems that one can not read the >> entire routing table using the PF_ROUTE sockets and RTM_GET returns >> information pertaining to only one destination. This suprised me >> because one can do such a thing with the Linux kernel's RTNETLINK. >> >> Is there a reason why this is so? Or is reading from /dev/kmem the >> only way to get a dump of the routing tables? >> > > You want 'netstat -rn' to dump them, this is a very common command which > should be present in a number of online resources on using and > administering FreeBSD so I am somewhat surprised that you didn't find it. > > P.S. Look in the sysctl tree if you need to snapshot the kernel IP > forwarding tables. You can use kmem, but it is generally frowned upon > unless you're working from core dumps -- kernels can be built without > kmem support, or kmem locked down, etc. unfortunatly netstat -rn uses /dev/kmem we've just never got around to implementing a better interface.. > > cheers > BMS > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"