# [SOLVED]: What name should I use?

## ONEEYEMAN

Hi, ALL,

I used to have "lo", "eth0" and "eth1" device names for the network interface.

Now when I install new udev-141, I am receiving:

```

ifconfig eth1 up

eth1: ERROR while getting interface flags: No such device

```

What should be the name of my wireless interface? Can I keep "eth1"?

Thank you.Last edited by ONEEYEMAN on Mon Sep 28, 2009 2:57 am; edited 1 time in total

----------

## desultory

 *ONEEYEMAN wrote:*   

> What should be the name of my wireless interface?

 

```
/sbin/ifconfig -a
```

 *ONEEYEMAN wrote:*   

> Can I keep "eth1"?

 You can call it whatever you like.

----------

## ONEEYEMAN

Hi, desultory,

I just read a post-installation message of udev. It says:

```

Updating persistent-net rules file

restarting udevd now.

persistent-net does assigning fixed names to network devices.

If you have problemswith the persistent-net rules,

just delete the rules file

     rm /etc/udev/rules.d/70-persistent-net.rules

and then reboot

This may however number your devices in a different way then they are now.

```

Am I suppose to follow or just add the new rule in this file?

Thank you.

----------

## jomen

Read the file first.

entries look like this:

```
# PCI device 0x10ec:0x8139 (8139too)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:00:f0:92:9f:e6", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
```

for every device which was present at any time a name was created - but you can change the "NAME = key" if you want it to be different.

Or delete the file - it will be re-created on next boot with just the devices present now. Then look at the names and use these or change them.

----------

## ONEEYEMAN

Hi,

This is what I have in the file:

```

# PCI device 0x14e4:0x4311 (bcm43xx)

SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:16:cf:0c:09:03", KERNEL=="eth*", NAME="eth1"

# PCI device 0x14e4:0x170c (b44)

SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:15:c5:a4:ba:e6", KERNEL=="eth*", NAME="eth0"

```

I guess I have to kill this file, because it states old name for my wireless card...

Thank you.

----------

## jomen

 *Quote:*   

> I guess I have to kill this file, because it states old name for my wireless card... 

 

If this was intended as a question then I'd ask:

which of these is the wireless card you are talking about?

To make it simple: kill it and give the cards the name you want them to have after the file has been recreated automatically (reboot - there sure is one but I don't know another method).

----------

## ONEEYEMAN

Hi, jomen,

I killed the file and rebooted.

But the file was not re-created.

When I issue "ls -la /etc/udev/rules.d" I don't see this file anymore...

Thank you.

----------

## jomen

Check /etc/conf.d/udev for whether you set:

```
# Disable adding new rules for persistent-net

persistent_net_disable="no"
```

to "yes"

When udev is started by init, it checks if the file is there and runs the script to create it if it is not.

[edit] actually - thats not correct - you can look at /etc/init.d/udev for how it works

[/edit]

Alternatively run:

```
udevadm trigger --subsystem-match=net
```

to create the file.

I just did it to check if it really works.

 *Quote:*   

> ...after the file has been recreated automatically (reboot - there sure is one but I don't know another method).

 

So now I know this other way too, thanks   :Smile: 

----------

## ONEEYEMAN

 *jomen wrote:*   

> 
> 
> Check /etc/conf.d/udev for whether you set:
> 
> ```
> ...

 

No this option is still set to "no".

 *jomen wrote:*   

> 
> 
> Alternatively run:
> 
> ```
> ...

 

I just tried to execute this command. There was no output.

However, in the /etc/udev/rules.d there is no file "*-persistent-net.rules".

Here is the content of this directory:

```

.keep_sys-fs_udev-0

05-udev-early.rules

50-udev.rules

60-persistent-storage.rules

64-device-mapper.rules

70-persistent-cd.rules

75-persistent-net-generator.rules

90-hal.rules

```

And "/sbin/ifconfig -a" still does not show eth1, but does show eth0...

Thank you.

----------

## jomen

My udev version is 146 (~x86 system).

For me the filename is 70-persistent-net.rules

Might be different for your version of udev (141)

```
75-persistent-net-generator.rules 
```

sounds like a candidate - maybe that is the file which was created?

```
ls -al /etc/udev/rules.d/
```

I don't have this file 75-persistent-net-generator.rules.

Have you looked at whats inside it?

Although the message at install mentioned the filename 70-persistent-net.rules specifically...

Someone running a stable (not ~x86) system might know better.

I just can tell about what I see and how it works here.

At least nothing is broken and the deleted file is easily recreated - its contents are posted here...

Sorry, but I can't really help much more.

----------

## ONEEYEMAN

Hi, jomen,

Here is the content of this file:

```

# these rules generate rules for persistent network device naming

ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS!="xen", \

   KERNEL=="eth*|ath*|wlan*|ra*|sta*", \

   NAME!="?*", DRIVERS=="?*", GOTO="persistent_net_generator_do"

GOTO="persistent_net_generator_end"

LABEL="persistent_net_generator_do"

# build device description string to add a comment the generated rule

SUBSYSTEMS=="pci", ENV{COMMENT}="PCI device $attr{vendor}:$attr{device} ($attr{driver})"

SUBSYSTEMS=="usb", ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct} ($attr{driver})"

SUBSYSTEMS=="ieee1394", ENV{COMMENT}="Firewire device $attr{host_id})"

ENV{COMMENT}=="", ENV{COMMENT}="$env{SUBSYSTEM} device ($attr{driver})"

IMPORT{program}="write_net_rules $attr{address}"

ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}"

LABEL="persistent_net_generator_end"

```

Thank you.

UPDATE:

I found this, but it's for udev-103, and running the command referenced gives "missing $INTERFACE"

----------

## ONEEYEMAN

Hi, ALL,

For now I will use wlan0, but mistery remains:

What happened to my old "persistent-net.rules" file and why it wasn't recreated.

If somebody knows the solution, will it be possible to share, please?

Thank you.

----------

## jomen

A few things to check for:

http://www.gentoo.org/doc/en/udev-guide.xml

Do you have inotify enabled in your kernel?

Do you use an initrd (genkernel)? The ebuild for udev-141 (as well higher versions) mentions:

 *Quote:*   

> "If you build an initramfs including udev, then please"
> 
> "make sure that the /sbin/udevadm binary gets included,"
> 
> "and your scripts changed to use it,as it replaces the"
> ...

 

The file 75-persistent-net-generator.rules is mentioned only 

in an old bug-report from April 2007 (quick google search) --> https://bugs.gentoo.org/173797

and in the ebuild for udev-114 - and only for s390 machines.

Maybe just reinstalling udev will help - backing up the /etc/udev/ directory and removing it before doing so?

That way the install script would generate everything currently needed anew - I think.

FWIW

I - here - have neighter of:

```
05-udev-early.rules

50-udev.rules

60-persistent-storage.rules

64-device-mapper.rules - as it is not installed here

75-persistent-net-generator.rules
```

instead I have these files in /etc/udev/rules.d/

```
10-udev-my.rules

10-virtualbox.rules

53-irda.rules

60-pcmcia.rules

70-bluetooth-pcmcia.rules

70-bluetooth.rules

70-libgphoto2.rules

70-libsane.rules

70-persistent-cd.rules

70-persistent-net.rules

90-hal.rules

99-fuse.rules
```

Maybe you have "dispatch-conf" not configured right so that old stuff does not get removed?

Nowhere in my config-archive of recent updates to udev can I find anything like 75-persistent-net-generator.rules having ever existed here

and the file 50-udev.rules (for instance) was removed and gone in June 2007 - as well as the file 60-persistent-storage.rules

----------

## ONEEYEMAN

 *jomen wrote:*   

> 
> 
> A few things to check for:
> 
> http://www.gentoo.org/doc/en/udev-guide.xml
> ...

 

I went through this document, but didn't find anything interesting...  :Wink: 

 *jomen wrote:*   

> 
> 
> Do you have inotify enabled in your kernel?
> 
> Do you use an initrd (genkernel)? The ebuild for udev-141 (as well higher versions) mentions:
> ...

 

Yes, I do have "Inotify" support in my kernel and I didn't use genkernel to create it.

 *jomen wrote:*   

> 
> 
> The file 75-persistent-net-generator.rules is mentioned only 
> 
> in an old bug-report from April 2007 (quick google search) --> https://bugs.gentoo.org/173797
> ...

 

I just tried this. I was able to boot into the machine, but upon checking there is only one file in /etc/udev/rules.d directory: .keep_sys-fs_udev-0

and the length of this file is 0. Also during boot I noticed that my sound card driver didn't load and my network cards was not load properly.

One more thing: I'm using the USB device for my development, and before backing up this directory and rebooting, the device name was hopping, i.e. one minute it's /dev/sdb and the next it's /dev/sdc. So I guess I will have to somehow work around thihs problem.

 *jomen wrote:*   

> 
> 
> FWIW
> 
> I - here - have neighter of:
> ...

 

Where can I find about "dispatch-conf" configuration?

What surprises me though is that I was able to boot into the system without any "rules.d" file...

Thank you.

----------

## jomen

 *Quote:*   

> Where can I find about "dispatch-conf" configuration? 

 

It is part of portage and is (to me) an functionally enhanced version of the command "etc-update" 

(which is to be run after installing new/updated packages when the final messages after an emerge ... tell you so).

It can keep records of what changed between versions - thats how I could tell about the files above:

some where present, but only until more than 2 years ago, one never has been there - at least not since I started to use "dispatch-conf" - which appearently has been also more than two years ago.

 *Quote:*   

> Where can I find about "dispatch-conf" configuration?

 

it might be documented better somewhere but the file itself gives clues:

/etc/dispatch-conf.conf

Again, FWIW:

because I could not find to which ebuild the files:

70-persistent-cd.rules and 70-persistent-net.rules

belonged,

I just removed

/etc/conf.d/udev

and the whole directory /etc/udev with everything in it.

Then I re-emerged udev - and the directory was empty as you described.

I rebooted - and it was populated again:

```
ls -1 /etc/udev/rules.d/

70-persistent-cd.rules

70-persistent-net.rules

90-hal.rules
```

the last line was only present after I also re-emerged "hal"

All other files belong to other ebuilds and will be re-created when re-emerging them (irda.rules, fuse.rules and the others I mentioned)

If these files are not re-created for you on reboot then I can not help any farther - someone else might know.

Check /etc/conf.d/udev again for something preventing that to happen - maybe "rc_device_tarball="NO"" is set to yes and uncommented?

I don't know - sorry!

----------

## ONEEYEMAN

Hi,

Yes, I completely forgot about "etc-update".   :Very Happy: 

I just merged the configuration for udev and rebooted. Now I have 2 files in there 70-persistent-net.rules and 70-persistent-cd.rules

Now I need to merge hal configuration and reboot, so that hal rules can be re-created...

Hopefully this thread will help someone else..

Thank you.

P.S.: In the newly created 70-persistent-net.rules file it uses the rule:

KERNEL == "wlan0" NAME = "wlan*"

I wonder why it uses "wlan0" as the name from the kernel?

----------

## jomen

 *Quote:*   

> Yes, I completely forgot about "etc-update"

 

...but the messages after each finished emerge do remind you of it - there could have been real serious trouble, not just this.

Well - with a live-CD, nothing is really serious...

I get eth1 for my built in wireless card (ipw2200).

When I plug in some other card via PCMCIA it gets a wlanX name.

But I think this depends on the chipset/driver used for that card and not whether its built in or external.

Some drivers use ethX, others wlanX names - don't know better than that.

----------

