From mboxrd@z Thu Jan 1 00:00:00 1970 From: mikep Date: Mon, 10 May 2004 12:41:39 +0000 Subject: Re: how to rename network interface? Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org mikep wrote: > Kay Sievers wrote: > >> On Sun, 2004-05-09 at 14:24 -0400, mikep wrote: >> >>> Using udev-025 i am trying to rename eth0 with these rules in >>> 50-udev.rules: >>> >>> BUS="pci", SYSFS{device}="0x8169", NAME="eth0" >>> BUS="pci", SYSFS{device}="0x8139", NAME="eth1" >> >> >> >> What does udevinfo show? >> udevinfo -p /class/net/eth0 -a >> > 7:16 >>udevinfo -p /class/net/eth0 -a > > looking at class device '/sys/class/net/eth0': > SYSFS{addr_len}="6" > SYSFS{address}="00:01:0a:10:a7:3b" > SYSFS{broadcast}="ff:ff:ff:ff:ff:ff" > SYSFS{features}="0x29" > SYSFS{flags}="0x1003" > SYSFS{ifindex}="2" > SYSFS{iflink}="2" > SYSFS{mtu}="1500" > SYSFS{tx_queue_len}="1000" > SYSFS{type}="1" > > follow the class device's "device" > looking at the device chain at > '/sys/devices/pci0000:00/0000:00:08.0/0000:01:07.0': > BUS="pci" > ID="0000:01:07.0" > SYSFS{class}="0x020000" > SYSFS{detach_state}="0" > SYSFS{device}="0x8139" > SYSFS{irq}="5" > SYSFS{subsystem_device}="0x8139" > SYSFS{subsystem_vendor}="0x1436" > SYSFS{vendor}="0x10ec" > > looking at the device chain at '/sys/devices/pci0000:00/0000:00:08.0': > BUS="pci" > ID="0000:00:08.0" > SYSFS{class}="0x060400" > SYSFS{detach_state}="0" > SYSFS{device}="0x006c" > SYSFS{irq}="0" > SYSFS{subsystem_device}="0x0000" > SYSFS{subsystem_vendor}="0x0000" > SYSFS{vendor}="0x10de" > > looking at the device chain at '/sys/devices/pci0000:00': > BUS="" > ID="pci0000:00" > SYSFS{detach_state}="0" > > And udevinfo for eth1 shows: > > looking at class device '/sys/class/net/eth1': > SYSFS{addr_len}="6" > SYSFS{address}="00:08:54:d1:a0:d5" > SYSFS{broadcast}="ff:ff:ff:ff:ff:ff" > SYSFS{features}="0x0" > SYSFS{flags}="0x1002" > SYSFS{ifindex}="3" > SYSFS{iflink}="3" > SYSFS{mtu}="1500" > SYSFS{tx_queue_len}="1000" > SYSFS{type}="1" > > follow the class device's "device" > looking at the device chain at > '/sys/devices/pci0000:00/0000:00:08.0/0000:01:08.0': > BUS="pci" > ID="0000:01:08.0" > SYSFS{class}="0x020000" > SYSFS{detach_state}="0" > SYSFS{device}="0x8169" > SYSFS{irq}="11" > SYSFS{subsystem_device}="0x8169" > ...................................... > I also tried these rules without success: > > KERNEL="eth*", SYSFS{address}="00:08:54:d1:a0:d5", NAME="eth0" > KERNEL="eth*", SYSFS{address}="00:01:0a:10:a7:3b", NAME="eth1" > > If i use 'nameif' in the hotplug script net.agent it works. But i prefer > to rename the interface by device type rather than address. > Some more info as I added the rules to a new file: 10-udev.rules ##Rename network interfaces BUS="pci", SYSFS{device}="0x8169", NAME="eth0" BUS="pci", SYSFS{device}="0x8139", NAME="eth1" KERNEL="eth*", SYSFS{address}="00:08:54:d1:a0:d5", NAME="eth0" KERNEL="eth*", SYSFS{address}="00:01:0a:10:a7:3b", NAME="eth1" and syslog shows that the rules are applied: udev[7620]: configured rule in '/etc/udev/rules.d//10-udev.rules' at line 3 applied, 'eth0' becomes 'eth1' udev[7621]: configured rule in '/etc/udev/rules.d//10-udev.rules' at line 2 applied, 'eth1' becomes 'eth0' However, the end result is that device 0x8139 is still configured as eth0 as ifconfig shows: >>ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:01:0A:10:A7:3B inet addr:192.168.0.5 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 ..................... I am using Gentoo linux. ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel