From owner-freebsd-questions@FreeBSD.ORG Sun Apr 24 21:09:52 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDCC7106564A for ; Sun, 24 Apr 2011 21:09:52 +0000 (UTC) (envelope-from fourquau@phare.normalesup.org) Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by mx1.freebsd.org (Postfix) with ESMTP id 75DE28FC1B for ; Sun, 24 Apr 2011 21:09:52 +0000 (UTC) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id p3OKTsal072721 for ; Sun, 24 Apr 2011 22:29:55 +0200 (CEST) X-Envelope-To: Received: by phare.normalesup.org (Postfix, from userid 1003) id B790ABC24B; Sun, 24 Apr 2011 22:29:54 +0200 (CEST) Date: Sun, 24 Apr 2011 22:29:54 +0200 From: Lionel Fourquaux To: freebsd-questions@freebsd.org Message-ID: <20110424202954.GA16373@phare.normalesup.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline X-PGP-Fingerprint: 24B5 DFFD 45C1 E9E4 8A16 B30B AB33 3E73 C79D F8E1 User-Agent: Mutt/1.5.20 (2009-06-14) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.1.4 (nef2.ens.fr [129.199.96.32]); Sun, 24 Apr 2011 22:29:55 +0200 (CEST) Subject: routing to a directly attached subnet without an address in this subnet X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 21:09:52 -0000 Dear FreeBSD users, Consider an IPv6 router with two interfaces, e.g. em0 and em1. em0 has addresses fe80::1234:56ff:fe78:9abc and 2001:db8::1 em1 has address fe80::1234:56ff:fe78:9abd Network 2001:db8::/64 is directly attached to em0, and network 2001:db8:0:1::/64 is directly attached to em1. The default route points to em0. I would like to route packets addressed to 2001:db8:0:1::/64 to interface em1, without allocating an address in 2001:db8:0:1::/64 for em1. (Or to understand why this would be impossible). I have tried to add a route using: route add -ipv6 2001:db8:0:1::/64 -iface em1 (and several variations), but this fails (route returns successfully, but I can't ping anything on 2001:db8:0:1::/64). On the other hand, if I give address 2001:db8:0:1::1/64 to em1, ping6 works and packets are routed successfully. I guess that the differenceis that the OS can't figure out which interface to use for NDP in the first case. However, ndp(8) can create static entries in the NDP table for individual hosts but not whole subnets. I can't see any strong reason for requiring that em1 have an address for every directly attached subnet packets are routed to. The router already has a valid routable address on em0 which can be used as source address for ICMP, and it has an address on em1 (the link local one) which can be used for NDP and routing. So: 1. Is there a way to set up the router the way I want it? 2. If not, why is it not possible? I can mark the additional addresses on em1 as deprecated, possibly even firewall out anything going to these addresses. From the outside, the router would behave exactly the way I want. However, this does not seem as nice as such a simple setup should be. This is on FreeBSD 8.2 (i386), GENERIC kernel. I have slightly simplified the description but all the relevant parts should be here. Anticipated thanks for your answers, and best regards. -- Lionel Fourquaux