From owner-freebsd-net@freebsd.org Thu Oct 22 23:34:17 2015 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D140A1CAC5 for ; Thu, 22 Oct 2015 23:34:17 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AC04164E for ; Thu, 22 Oct 2015 23:34:17 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by obbwb3 with SMTP id wb3so81289170obb.0 for ; Thu, 22 Oct 2015 16:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=hBE1Kk/j5PgXPrE49zep5rpKo4ueg6P686JrbU95E5g=; b=pTy0i/EBPlFPJ6RkXHRwy/g45yJajTWd3h4xr3tYZz70wP10ZWJBChgKVmn1FQYXFj bCsk0KeKBVLwCS2nqDyWBKFITFXp7nIHeJU5vMdnJ6W1JWjAoZmDbiPa1FxRlEq6Gmdk fXX6caOMxyBJLpgCzGT/V1Suaad/44FYluTuMoVm7zSg42ncZ3aZgPq4c8eo08nKxbq/ yFuiD8geRjUFetXjk+AI2TPZ37fn5838rD4sKZ9WaU9q+fSLUVCtCI9tXZWMK9c63kvn 62MentEMP3SZxJ6WIvyuZVw79kKqmeTN6Ky5WFp7xErGuPzFJQHJc9MxwgaylJ00FoEj CuUA== MIME-Version: 1.0 X-Received: by 10.60.41.9 with SMTP id b9mr12648831oel.37.1445556856336; Thu, 22 Oct 2015 16:34:16 -0700 (PDT) Sender: kob6558@gmail.com Received: by 10.202.50.136 with HTTP; Thu, 22 Oct 2015 16:34:16 -0700 (PDT) In-Reply-To: <20151022230838.GA22065@drscott.swordarmor.fr> References: <20151022230838.GA22065@drscott.swordarmor.fr> Date: Thu, 22 Oct 2015 16:34:16 -0700 X-Google-Sender-Auth: 82wgWscKGYmzYpAtusgJ60L_uVU Message-ID: Subject: Re: Cannot add an ipv6 route with -interface From: Kevin Oberman To: Alarig Le lay Cc: "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2015 23:34:17 -0000 On Thu, Oct 22, 2015 at 4:08 PM, Alarig Le lay wrote: > Hi, > > I try to add an IPv6 route on a 10.1 FreeBSD router by using the option > -interface. It works with IPv4 but not with IPv6. > > In IPv4: > alarig@nominoe:~ % ping 192.168.1.1 > PING 192.168.1.1 (192.168.1.1): 56 data bytes > 76 bytes from te0-0-2-2.rcr11.uro01.atlas.cogentco.com (130.117.1.242): > Destination Net Unreachable > Vr HL TOS Len ID Flg off TTL Pro cks Src Dst > 4 5 68 0054 0bea 0 0000 3e 01 d145 149.6.72.98 192.168.1.1 > alarig@nominoe:~ % sudo route add 192.168.1.0/24 -interface em1 > add net 192.168.1.0: gateway em1 > alarig@nominoe:~ % ping 192.168.1.1 > PING 192.168.1.1 (192.168.1.1): 56 data bytes > 64 bytes from 192.168.1.1: icmp_seq=75 ttl=64 time=0.831 ms > > In IPv6: > alarig@nominoe:~ % ping6 2a00:5884:8200::100 > PING6(56=40+8+8 bytes) 2001:978:2:4e::5:2 --> 2a00:5884:8200::100 > ^C > --- 2a00:5884:8200::100 ping6 statistics --- > 3 packets transmitted, 0 packets received, 100.0% packet loss > > alarig@nominoe:~ % sudo route add -6 2a00:5884:8200::/40 -interface em1 > add net 2a00:5884:8200::/40: gateway em1 > alarig@nominoe:~ % ping6 2a00:5884:8200::100 > PING6(56=40+8+8 bytes) 2a00:5884::1 --> 2a00:5884:8200::100 > ping6: sendmsg: Operation not permitted > ping6: wrote 2a00:5884:8200::100 16 chars, ret=-1 > > This operation works on linux: > alarig@judicael:~$ ping6 2a00:5884:8200::100 > PING 2a00:5884:8200::100(2a00:5884:8200::100) 56 data bytes > From 2a00:5884::1 icmp_seq=1 Destination unreachable: Address > unreachable > From 2a00:5884::1 icmp_seq=2 Destination unreachable: Address > unreachable > ^C > --- 2a00:5884:8200::100 ping statistics --- > 2 packets transmitted, 0 received, +2 errors, 100% packet loss, time > 1007ms > alarig@judicael:~$ sudo ip -6 route add 2a00:5884:8200::/40 dev eth0 > alarig@judicael:~$ ping6 2a00:5884:8200::100 > PING 2a00:5884:8200::100(2a00:5884:8200::100) 56 data bytes > 64 bytes from 2a00:5884:8200::100: icmp_seq=1 ttl=63 time=1.41 ms > 64 bytes from 2a00:5884:8200::100: icmp_seq=2 ttl=63 time=0.588 ms > 64 bytes from 2a00:5884:8200::100: icmp_seq=3 ttl=63 time=0.459 ms > ^C > --- 2a00:5884:8200::100 ping statistics --- > 3 packets transmitted, 3 received, 0% packet loss, time 2000ms > rtt min/avg/max/mdev = 0.459/0.819/1.410/0.421 ms > > It also works if I add an intermediate router: > alarig@nominoe:~ % sudo route add -6 2a00:5884:8200::/40 2a00:5884::3 > add net 2a00:5884:8200::/40: gateway 2a00:5884::3 > alarig@nominoe:~ % ping6 2a00:5884:8200::100 > PING6(56=40+8+8 bytes) 2a00:5884::1 --> 2a00:5884:8200::100 > 16 bytes from 2a00:5884:8200::100, icmp_seq=0 hlim=64 time=0.590 ms > 16 bytes from 2a00:5884:8200::100, icmp_seq=1 hlim=64 time=0.699 ms > 16 bytes from 2a00:5884:8200::100, icmp_seq=2 hlim=64 time=0.764 ms > 16 bytes from 2a00:5884:8200::100, icmp_seq=3 hlim=64 time=0.806 ms > ^C > --- 2a00:5884:8200::100 ping6 statistics --- > 4 packets transmitted, 4 packets received, 0.0% packet loss > round-trip min/avg/max/std-dev = 0.590/0.715/0.806/0.081 ms > > > This router is theoretically useless as it is on the same network than the > FreeBSD one. > > Do you have any idea about this issue? Did I make a mistake or is it a > bug? > > Thanks, > -- > Alarig Le Lay > Take a look at route(8). There are significant syntax differences. E.g. On FreeBSD route(8) has no "-6" option. It uses "-inet6". That may not be the only issue, but I need to get out the door to get to a hockey match. the rest is at least close. -- Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683