From owner-freebsd-net@FreeBSD.ORG Sat Mar 5 20:10:21 2011 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 F2E6C106564A for ; Sat, 5 Mar 2011 20:10:20 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id A8CD48FC24 for ; Sat, 5 Mar 2011 20:10:20 +0000 (UTC) Received: by qwj8 with SMTP id 8so2631751qwj.13 for ; Sat, 05 Mar 2011 12:10:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=aUnqbRBkHAFWZHXtH5KmVAD7L6OUbn7oK/LfYNQ77Xo=; b=cgd+34700Z7qhFXwpvp+lqNwdId9pkEcBOsBmiEUNGqROjuVh9xiu3jajYvNdeLEID cyu6Lj8+j1NoLTwPxGmSWHXMj/gSr+3RkSMTL4f9fzKHPnYJuGdoCVNEC3vjtgPVvL2i P3NO/298/1HCQvHAUrQIbkLzcipPAaoaOjGQo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=tv53g21ui2VMgixodP1v/7jF7+mtgcmECvbrfyfgsdSuckQ4dV9fCDtMrhVyFbkGIc oUEnONsILVQsDMN+cJks1x7+VlJwXPI/0Wd+2p/K/d2iaIAWHqMORmJlDn6zHe5aQroe IGKa4/DlQjNvHpAaPhZXXoii7LtsjHk3f7yK4= MIME-Version: 1.0 Received: by 10.229.78.230 with SMTP id m38mr1716170qck.17.1299355819606; Sat, 05 Mar 2011 12:10:19 -0800 (PST) Received: by 10.229.84.129 with HTTP; Sat, 5 Mar 2011 12:10:19 -0800 (PST) In-Reply-To: <201103051943.41917.fredan@fredan.se> References: <201103051943.41917.fredan@fredan.se> Date: Sat, 5 Mar 2011 23:10:19 +0300 Message-ID: From: Sergey Kandaurov To: fredrik danerklint Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Net Subject: Re: ifconfig lo1 down 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: Sat, 05 Mar 2011 20:10:21 -0000 On 5 March 2011 21:43, fredrik danerklint wrote: > Hi, > > I would like to know what is the differents between ip4 and ip6 for this > command. > > First: > > #ifconfig lo1 > lo1: flags=3D8049 metric 0 mtu 16384 > =A0 =A0 =A0 =A0options=3D3 > =A0 =A0 =A0 =A0inet xx.xx.xx.2 netmask 0xffffffff > =A0 =A0 =A0 =A0inet6 2a03:xxxx:xxxx::xxxx:xx02 prefixlen 128 > =A0 =A0 =A0 =A0nd6 options=3D3 > > $ ping xx.xx.xx.2 > PING xx.xx.xx.2 (xx.xx.xx.2): 56 data bytes > 64 bytes from xx.xx.xx.2: icmp_seq=3D0 ttl=3D64 time=3D0.012 ms > 64 bytes from xx.xx.xx.2: icmp_seq=3D1 ttl=3D64 time=3D0.010 ms > ^C > > and > > $ ping6 2a03:xxxx:xxxx::xxxx:xx02 > PING6(56=3D40+8+8 bytes) 2a03:xxxx:xxxx::xxxx:xx02 --> 2a03:xxxx:xxxx::xx= xx:xx02 > 16 bytes from 2a03:xxxx:xxxx::xxxx:xx02, icmp_seq=3D0 hlim=3D64 time=3D0.= 053 ms > 16 bytes from 2a03:xxxx:xxxx::xxxx:xx02, icmp_seq=3D1 hlim=3D64 time=3D0.= 032 ms > ^C > > Now we run this command: > > # ifconfig lo1 down > > and trying to ping again: > > $ ping xx.xx.xx.2 > PING xx.xx.xx.2 (xx.xx.xx.2): 56 data bytes > ping: sendto: No route to host > ping: sendto: No route to host > ping: sendto: No route to host > ^C > --- xx.xx.xx.2 ping statistics --- > 3 packets transmitted, 0 packets received, 100.0% packet loss > > works as expected (and this is what I want) but this command, however: > > $ ping6 2a03:xxxx:xxxx::xxxx:xx02 > PING6(56=3D40+8+8 bytes) 2a03:xxxx:xxxx::xxxx:xx02 --> 2a03:xxxx:xxxx::xx= xx:xx02 > 16 bytes from 2a03:xxxx:xxxx::xxxx:xx02, icmp_seq=3D0 hlim=3D64 time=3D0.= 048 ms > 16 bytes from 2a03:xxxx:xxxx::xxxx:xx02, icmp_seq=3D1 hlim=3D64 time=3D0.= 033 ms > 16 bytes from 2a03:xxxx:xxxx::xxxx:xx02, icmp_seq=3D2 hlim=3D64 time=3D0.= 032 ms > ^C > --- 2a03:xxxx:xxxx::xxxx:xx02 ping6 statistics --- > 3 packets transmitted, 3 packets received, 0.0% packet loss > round-trip min/avg/max/std-dev =3D 0.032/0.038/0.048/0.007 ms > > My question is why is it not the same behavior of ip6 as of ip4? > That's how forwarding works/differs for ipv4 and ipv6. You should be able to ping xx.xx.xx.2 again after adding static route. Something like route add xx.xx.xx.2 -iface -lo1. I can only say for the moment that from my observation ipv4 "routes to itse= lf" exist as far as interface is up, and ipv6 routes don't depend on if iface i= s up. You can check this with netstat -r for both addresses with iface up and dow= n. --=20 wbr, pluknet