From owner-freebsd-net@FreeBSD.ORG Mon Sep 4 07:23:18 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C2BB16A4DA; Mon, 4 Sep 2006 07:23:18 +0000 (UTC) (envelope-from jhay@meraka.csir.co.za) Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za [146.64.24.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4AB843D45; Mon, 4 Sep 2006 07:23:16 +0000 (GMT) (envelope-from jhay@meraka.csir.co.za) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973) id E9EF833CAE; Mon, 4 Sep 2006 09:23:13 +0200 (SAST) Date: Mon, 4 Sep 2006 09:23:13 +0200 From: John Hay To: gnn@freebsd.org Message-ID: <20060904072313.GA83757@zibbi.meraka.csir.co.za> References: <20060903132214.GA40993@zibbi.meraka.csir.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: freebsd-net@freebsd.org Subject: Re: ipv6 host routes 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: Mon, 04 Sep 2006 07:23:18 -0000 On Mon, Sep 04, 2006 at 11:04:44AM +0900, gnn@freebsd.org wrote: > At Sun, 3 Sep 2006 15:22:14 +0200, > John Hay wrote: > > > > Hi, > > > > Does anybody know how to add a direct IPv6 host route that actually works? > > What I mean is not through a gateway, but for one directly reachable. > > > > I know it normally isn't needed because it will just work, but I'm > > trying to add FreeBSD IPv6 capability to net/olsrd. It looks like I have > > most of the rest working, but this is one of the last things tripping > > me up. ... > > > > So anybody that know how to add a direct IPv6 host route on FreeBSD? > > > > Can you show us the commands, network layout and the output of netstat > -r and ndp -a? Well maybe I should start with how it works on IPv4. You can see the code in work/olsrd-0.4.10/src/bsd/kernel_routes.c if you extract the net/olsrd port. In the case where the machine is directly connected, ie. not through a gateway, a network route with a /32 netmask is added with the cloning flag. So if you use the 10.1.9.0/24 network and have two hosts that can "see" each other, 10.1.9.1 and 10.1.9.2, on 10.1.9.1 you will see a route like this added: 10.1.9.2/32 link#2 UC 0 0 ath1 and as soon as there is traffic the arp will cause this: 10.1.9.2 00:02:6f:34:21:a2 UHLW 2 2286102 ath1 1176 => So I guess I want to imitate something like this in a way that the linux boxes that also run olsr can interoperate. My current test setup have 3 boxes on the 2001:4200:7000:15:: subnet, so ifconfig on rtrg looks like this: ################ ath0: flags=8843 mtu 1500 inet6 fe80::202:6fff:fe22:9547%ath0 prefixlen 64 scopeid 0x3 inet6 2001:4200:7000:15:202:6fff:fe22:9547 prefixlen 64 inet6 2001:4200:7000:15:: prefixlen 64 anycast ether 00:02:6f:22:95:47 media: IEEE 802.11 Wireless Ethernet autoselect (autoselect ) status: associated ssid koppiemesh channel 149 bssid 02:02:6f:41:19:27 authmode OPEN privacy OFF txpowmax 24 bmiss 7 burst bintval 100 ################ To lessen my typing I have these entries in /etc/hosts: 2001:4200:7000:15:202:6fff:fe22:9547 rtrg 2001:4200:7000:15:202:6fff:fe41:1927 rtr2 The machine I am working on is the first one, rtrg. If I don't do anything, I can ping6 rtr2, but I would like to add a route and still have it work. I have tried many things on rtrg but none seem to give me something that works. Some of the ones I have tried: route add -inet6 -host rtr2 -interface ath0 route add -inet6 -host rtr2 -interface ath0 -cloning -nostatic --llinfo route add -inet6 -net rtr2 -prefixlen 128 -interface ath0 -cloning -nostatic --llinfo route add -inet6 -host rtr2 fe80::202:6fff:fe22:9547%ath0 -ifp ath0 route add -inet6 -host rtr2 -interface fe80::202:6fff:fe22:9547%ath0 -ifp ath0 route add -inet6 -host rtr2 rtrg -cloning -nostatic Thanks. John -- John Hay -- John.Hay@meraka.csir.co.za / jhay@FreeBSD.org