# Udev network device renaming

## tsr

Hey,

I've been reading several old threads regarding udev and the renaming of devices.  The problem is, I can't seem to find any that are relatively recent, and the tips I've gleaned from the various threads don't seem to apply anymore.  The walkthrough at http://www.reactivated.net/udevrules.php doesn't seem to work either (possibly outdated?).  Anyway, in case something has changed that I'm not aware of, my setup is as follows:

/etc/udev/rules.d/10-local.rules (MAC addresses have been changed to protect the innocent):

```
KERNEL="eth*", SYSFS{address}="00:01:45:1f:ad:34", NAME="wireless"

KERNEL="eth*", SYSFS{address}="00:0a:37:86:c4:92", NAME="lan"
```

My /etc/init.d/ has both net.lan and net.wireless symlinked to net.lo with the net.eth0 symlink removed.  Devfs is removed from the kernel, and udev correctly works (beautifully, I might add), and just to be sure, I've got gentoo=nodevfs in my kernel boot options.  Also, my /etc/conf.d/net contains references to the correct devices (wireless and lan) instead of eth0 and eth1.  I want my two devices to be named lan and wireless, yet they are still being named eth0 and eth1 (depending on order of module loading).

Anyone have any ideas?

Edit: For clarityLast edited by tsr on Sun Nov 28, 2004 8:06 pm; edited 1 time in total

----------

## gentsquash

What isn't happening that you want to fix?

----------

## tsr

The devices are still eth0 and eth1, despite my best efforts.   :Sad: 

----------

## tsr

Bump for one last shot.  :Very Happy: 

----------

## Kovid

Works for me if i drop the KERNEL part

----------

## tsr

Tried dropping the kernel part and restarting, still no dice.  I double checked 

```
udevinfo -a -p /sys/class/net/eth0
```

 and verified that I had the MAC address correct... switched it to uppercase (and back) as well just for the hell of it.  No dice.  Did you take any other steps besides what I listed that could be part of the problem?

----------

## Kovid

Hmmm can't think of anything. What versions of udev and baselayout are you using? Have you setup a strict udev system?

----------

## tsr

Portage reports that I have udev version 046 and baselayout 1.11.6-r1.  I'm almost positive I have a strict udev system, i.e. my mouse is named udev style, and I have gentoo=nodevfs in the kernel options.  Just to be sure, I took devfs support out of the kernel before as well.  Is there any other way to be sure I'm strict udev?

----------

## Kovid

Make sure you have the following in /etc/conf.d/rc

RC_DEVICES="udev"

RC_DEVICE_TARBALL="no"

Another thing...Could you post the output of dmesg (only the sections where your network cards are being discovered...you can find them by grep eth0)

----------

## Dolio

Are the drivers for your network cards compiled as modules?

I did this, and was unable to rename my network cards if they were compiled directly into the kernel. And even when they were modules, the renaming on one of the network cards was spotty at best. But it never worked for me when they weren't modules.

----------

## tsr

Dolio: Yeah I've got them compiled as modules.  Thanks for the tip though  :Smile: 

Kovid: The RC_DEVICES was set to "udev", however, the RC_DEVICE_TARBALL was set to yes.  I changed this to "no", restarted, and they're still coming up eth1 and eth0.

As for the outputs:

dmesg | grep eth1

```
e100: eth1: e100_probe: addr 0xc0201000, irq 11, MAC addr 00:0D:60:12:E1:56
```

dmesg | grep eth0 doesn't give anything, as the wireless card came up first and it's an ipw2100 and doesn't display eth0 in dmesg at all.  If you're interested in comparing MAC addresses with my udev rules file, my rules file is this:

cat /etc/udev/rules.d/10-local.rules

```
KERNEL="eth*", SYSFS{address}="00:04:23:5c:ec:71", NAME="wireless"

KERNEL="eth*", SYSFS{address}="00:0d:60:12:e1:56", NAME="lan"
```

Thanks for the help so far guys  :Very Happy: 

----------

## Kovid

Sorry can't think of anything. You could try nameif as an alternative. See man nameif. You'd have to put it into a rc script and make sure its executed before net.eth*

----------

## tsr

Hey, thanks alot, I'll check that out  :Very Happy: 

----------

## quat

just FYI in udev ver.046 there is a bug connected with the issue you write. The solution is to apply the patch. Check it here or here.

after applying it i got it working perfectly.

----------

## tsr

Thanks alot man, I tried the patches though and still no go.  Just for fun, I think I'll try to downgrade to udev 045 to see if I've got everything set correctly.

----------

## tsr

Works like a charm in udev-045.  I'm positive I got that patch applied correctly, so I'm not sure what's up.  Glad to hear you got it working though.   :Very Happy: 

----------

