From owner-freebsd-net@FreeBSD.ORG Fri Dec 5 18:12:31 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 5665AE0A for ; Fri, 5 Dec 2014 18:12:31 +0000 (UTC) Received: from mailout-warwickshire.gigahost.dk (mailout-warwickshire.gigahost.dk [77.74.192.84]) by mx1.freebsd.org (Postfix) with ESMTP id 1E49685 for ; Fri, 5 Dec 2014 18:12:30 +0000 (UTC) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-warwickshire.gigahost.dk (Postfix) with ESMTP id CE6D9F61BA0; Fri, 5 Dec 2014 18:03:58 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.107]) by mailout.gigahost.dk (Postfix) with ESMTP id A3CFB25E102B; Fri, 5 Dec 2014 18:03:58 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id 95F1E466063B; Fri, 5 Dec 2014 18:03:58 +0000 (UTC) X-Screener-Id: 2bfb0ba3b22e70c1e23704465ce0c16e022de43a Received: from easynote (80-71-133-54.u.parknet.dk [80.71.133.54]) by smtp.gigahost.dk (Postfix) with ESMTPSA id 710D3466010F; Fri, 5 Dec 2014 18:03:58 +0000 (UTC) Date: Fri, 5 Dec 2014 19:02:55 +0100 From: To: freebsd-net@freebsd.org Subject: Re: NICs devices switches "pshycial" place on each boot (NOT SOLVED) Message-ID: <20141205190255.5f81982d@easynote> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Fri, 05 Dec 2014 18:12:31 -0000 Hi, The solution provided by, Martin before he started his travels, insn't working reliably. devd does not match axgeX with ueX in any fixed manner. So sometimes this will happen: ue0: on axge1 ue0: Ethernet address: 00:24:9b:0d:e0:0c ue1: on axge0 ue1 Ethernet address: 00:24:9b:0f:9d:3f ue2: on axge2 ue2: Ethernet address: 00:24:9b:0e:23:8e "axge1" has been given the "ue0" device name! So when we do a: attach 100 { device-name "axge[0-9]+"; match "vendor" "0x0b95"; match "product" "0x1790"; match "sernum" "0000249B0DE00C"; action "sleep 3"; action "ifconfig ue`echo $device-name | tr -dc '[0-9]'` name olan"; action "ifconfig olan inet 192.168.1.1 netmask 255.255.255.0"; }; }; .. because we're dealing with "axge1", yet it is had been given the "ue0" device name, the above match will rename the "ue1" device instead of the "ue0" device. So the hack is useless. The reason why this is not working (to my understanding) has to do with the assignment of irq numbers on each USB bus. Monitoring devd while attaching devices shows that some stuff are random - leading to the assignment of driver number (axgeX). devd performs the assignment of a device driver (axge) in one attach event and then performs the naming (ueX) in another attach event. The problem is with the second event because it does *not* contain the serial number or any other unique information at all. Currently it is not possible to get both in one go. What needs to be done IMHO is to figure out how devd assigns device names and then completely override that in the first match event. If not possible then another really ugly hack would be to probe ifconfig for device names, MAC addresses and IP numbers and then use that to rename and change things. But I would not want to rely on that! Cheers, Kim