From owner-freebsd-bugs@FreeBSD.ORG Tue Mar 11 22:10:01 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4567BBD0 for ; Tue, 11 Mar 2014 22:10:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 225D99F0 for ; Tue, 11 Mar 2014 22:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BMA0vV031597 for ; Tue, 11 Mar 2014 22:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s2BMA0V3031586; Tue, 11 Mar 2014 22:10:00 GMT (envelope-from gnats) Resent-Date: Tue, 11 Mar 2014 22:10:00 GMT Resent-Message-Id: <201403112210.s2BMA0V3031586@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Adam McDougall Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 994E1A88 for ; Tue, 11 Mar 2014 22:06:29 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85CF39A7 for ; Tue, 11 Mar 2014 22:06:29 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BM6S94085652 for ; Tue, 11 Mar 2014 22:06:28 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s2BM6SEf085651; Tue, 11 Mar 2014 22:06:28 GMT (envelope-from nobody) Message-Id: <201403112206.s2BM6SEf085651@cgiserv.freebsd.org> Date: Tue, 11 Mar 2014 22:06:28 GMT From: Adam McDougall To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: conf/187457: ifconfig IP range assignment too restrictive X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 22:10:01 -0000 >Number: 187457 >Category: conf >Synopsis: ifconfig IP range assignment too restrictive >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Mar 11 22:10:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Adam McDougall >Release: FreeBSD 10.0-STABLE >Organization: >Environment: FreeBSD build10 10.0-STABLE FreeBSD 10.0-STABLE #0 r262298: Fri Feb 21 18:28:26 EST 2014 root@build10:/usr/obj/usr/src/sys/BUILD10 amd64 >Description: Recently I came up with the need to assign almost every IP in a /24 subnet to an interface. I wanted to avoid 250+ lines in /etc/rc.conf so I read the rc.conf manpage and discovered the wonderful range feature where I thought I could use: ifconfig_lagg0_alias0="inet 10.0.30.2-254/24" I found out it only creates addresses up to around .34 and prints "Range specification is too large", all as an anti foot-shooting protection due to _IPEXPANDMAX=31 in /etc/network.subr. Could the code be changed to allow for example a whole /24 to be created with a single range? Looking at SVN, this appears to apply to 9 as well. Workaround: define a bunch of smaller ranges: ifconfig_lagg0_aliases="inet 10.0.30.2-31/24 inet 10.0.30.32-63/32 \ inet .... etc etc" >How-To-Repeat: Try to set a large range in /etc/rc.conf and reboot. ifconfig_interfacename0="up" ifconfig_interfacename0_alias0="inet 10.0.30.2-254/24" >Fix: Raise _IPEXPANDMAX=31 in network.subr? Untested but seems logical since the only apparent purpose is to prevent accidental misconfiguration. It is easy to see if the range is defined too large then it might make a poor choice regarding broadcast IPs, oversized netmasks or something. I didn't check exactly how many IPs it assigned, it should be near 32. I was in a rush and had to settle for a workaround that evening. >Release-Note: >Audit-Trail: >Unformatted: