From owner-freebsd-net@FreeBSD.ORG Wed Dec 3 17:32:19 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FA2CD66 for ; Wed, 3 Dec 2014 17:32:19 +0000 (UTC) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 43832FC4 for ; Wed, 3 Dec 2014 17:32:18 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.9/8.14.9) with ESMTP id sB3HWGQJ035980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 3 Dec 2014 10:32:17 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.9/8.14.9/Submit) with ESMTP id sB3HWGNp035977; Wed, 3 Dec 2014 10:32:16 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Wed, 3 Dec 2014 10:32:16 -0700 (MST) From: Warren Block To: Martin Hanson Subject: Re: NICs devices switches "pshycial" place on each boot In-Reply-To: <1511041417624247@web23g.yandex.ru> Message-ID: References: <1511041417624247@web23g.yandex.ru> User-Agent: Alpine 2.11 (BSF 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Wed, 03 Dec 2014 10:32:17 -0700 (MST) Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 17:32:19 -0000 On Wed, 3 Dec 2014, Martin Hanson wrote: > I got a small Intel Atom N280 box I wanted to use as a PF firewall. > > It has one Intel NIC that gets registered as "bge0", That would be Broadcom. > then it has three > USB->NIC dongles with the ASIX AX88179 chipset which gets registered > as "ue0", "ue1" and "ue2". > > I have set each device to a static IP during boot. > > The problem is however that upon boot the devices gets switched. > > So first boot: > > | USB DONGLE 1 | UE0 | 192.168.1.1 | > | USB DONGLE 2 | UE1 | 192.168.2.1 | > | USB DONGLE 3 | UE2 | 192.168.3.1 | > > Next boot: > > | USB DONGLE 1 | UE1 | 192.168.2.1 | > | USB DONGLE 2 | UE2 | 192.168.3.1 | > | USB DONGLE 3 | UE0 | 192.168.1.1 | > > Upon each boot the order changed, there is no fixed pattern. Right, USB devices are detected dynamically, and the order is not guaranteed. > This is a major problem as the device *still* has the right name and the > right IP, but it is as though it has been physically removed from the > slot and changed place. > > Is it somehow possible to deal with this problem? > > pciconf doesn't display those devices. usbconfig will show the USB devices, 'usbconfig -d 0.3 dump_device_desc' shows output from device 0.3. It might be possible to assign a unique name to each with 'ifconfig name' when they are detected by devd. That would depend on some unique ID for each that can be detected by devd. If they are all the same brand and model, vendor and product ID will not help. Serial number is often not set on USB devices. MAC address would work, if that is passed to devd.