From owner-freebsd-current@FreeBSD.ORG Mon Nov 5 16:29:52 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8352D150 for ; Mon, 5 Nov 2012 16:29:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3D6C38FC14 for ; Mon, 5 Nov 2012 16:29:52 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:d493:276:882f:463e] (unknown [IPv6:2001:7b8:3a7:0:d493:276:882f:463e]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 87B0D5C59; Mon, 5 Nov 2012 17:29:51 +0100 (CET) Message-ID: <5097E97D.80304@FreeBSD.org> Date: Mon, 05 Nov 2012 17:29:49 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alexandre Martins Subject: Re: Some question about IPv4 routes References: <8632523.6dTPfJQh0d@pc-alex.netasq.com> In-Reply-To: <8632523.6dTPfJQh0d@pc-alex.netasq.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 16:29:52 -0000 On 2012-11-05 17:21, Alexandre Martins wrote: > Since FreeBSD 8.0, there is some changes about routing table, in particular > the IPv4 'link-local' route. > > In my case, i have this config: em0 192.168.0.1 / 24 > > > In FreeBSD < 8, if I run 'route get 192.168.0.0', it tell me : > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > route to: 192.168.0.0 > destination: 192.168.0.0 > mask: 255.255.255.0 > interface: em0 > flags: > recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire > 0 0 0 0 0 0 1500 -537398 > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > > And in FreeBSD >= 8 > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > route: writing to routing socket: No such process > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Maybe the command parsing got more strict? It looks like you must add the netmask to make it work: $ route -n get 192.168.0.0 route: writing to routing socket: No such process $ route -n get 192.168.0.0/24 route to: 192.168.0.0 destination: 192.168.0.0 mask: 255.255.255.0 interface: iflan flags: recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 1 0 This is on stable/9. > In addition, if I run a ping on network and broadcast address > (ping 192.168.0.0; ping 192.168.0.255) > > In Freebsd < 8, a new route was created and i can see it in > 'netstat -rn -af inet' > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > Internet: > Destination Gateway Flags Refs Use Netif Expire > 192.168.0.0 ff:ff:ff:ff:ff:ff UHLWb 1 1 em0 => > 192.168.0.255 ff:ff:ff:ff:ff:ff UHLWb 1 1 em0 => > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > > But not in FreeBSD >= 8 > > > So, why is the broadcast route not created in FreeBSD >= 8 ? Apparently the route to 192.168.0.0/24 already covers both of them, so there is no need anymore to add explicit ones. I have no idea why this changed after 8.x, though.