linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to rename network interface?
@ 2004-05-09 18:24 mikep
  2004-05-10  2:05 ` Kay Sievers
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mikep @ 2004-05-09 18:24 UTC (permalink / raw)
  To: linux-hotplug

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"

udev-logging doesn't show any errors.



-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to rename network interface?
  2004-05-09 18:24 how to rename network interface? mikep
@ 2004-05-10  2:05 ` Kay Sievers
  2004-05-10 11:30 ` mikep
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2004-05-10  2:05 UTC (permalink / raw)
  To: linux-hotplug

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

> udev-logging doesn't show any errors.

You need to compile it with 'make DEBUG=true' to get a very detailed
log.

good luck,
Kay



-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to rename network interface?
  2004-05-09 18:24 how to rename network interface? mikep
  2004-05-10  2:05 ` Kay Sievers
@ 2004-05-10 11:30 ` mikep
  2004-05-10 12:41 ` mikep
  2004-05-11 10:41 ` Kay Sievers
  3 siblings, 0 replies; 5+ messages in thread
From: mikep @ 2004-05-10 11:30 UTC (permalink / raw)
  To: linux-hotplug

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.



-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to rename network interface?
  2004-05-09 18:24 how to rename network interface? mikep
  2004-05-10  2:05 ` Kay Sievers
  2004-05-10 11:30 ` mikep
@ 2004-05-10 12:41 ` mikep
  2004-05-11 10:41 ` Kay Sievers
  3 siblings, 0 replies; 5+ messages in thread
From: mikep @ 2004-05-10 12:41 UTC (permalink / raw)
  To: linux-hotplug

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to rename network interface?
  2004-05-09 18:24 how to rename network interface? mikep
                   ` (2 preceding siblings ...)
  2004-05-10 12:41 ` mikep
@ 2004-05-11 10:41 ` Kay Sievers
  3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2004-05-11 10:41 UTC (permalink / raw)
  To: linux-hotplug

On Mon, May 10, 2004 at 08:41:39AM -0400, mikep wrote:
> 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:

Are you sure the the interface is not in use, while udev tries to rename
it. Maybe your network script is faster than udev?

Kay


> >>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


-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-05-11 10:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-09 18:24 how to rename network interface? mikep
2004-05-10  2:05 ` Kay Sievers
2004-05-10 11:30 ` mikep
2004-05-10 12:41 ` mikep
2004-05-11 10:41 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).