# Udev - how to stop it creating Firewire eth device? [SOLVED]

## jcat

It seems like a few of us have been bitten over then last couple of days with Udev-103's Coldplug implementation.  Now I've sorted out my initial problems, I want to know how to get back in control of my system again properly.

Why is Udev creating an eth0 device for my Firewire port??

This is annoying for three reasons:

1. I don't want/need ethernet over firewire, so why add this device if it's not requested, and then (to add insult to injury) try and aquire a DHCP address.

2. It messes up my ethernet naming scheme, my primrary ethernet device used to be called eth0, why jumple it up.

3. I don't want/need ethernet over firewire!!!!!   :Rolling Eyes:   :Wink: 

I'm sure I'll be able to rectify this with some udev rules, I'm reading the docs currently, but just wondered if anyone has already created some appropriate rules to sort this out.  Please post them or advice as appropriate.

Thanks guys   :Cool: 

Cheers,

jcatLast edited by jcat on Mon Nov 27, 2006 8:39 pm; edited 1 time in total

----------

## anz

thanks, dear jcat - now, i know, that after upgrading to the udev-103, the "new" eth0 device is the firewire-over-ethernet.

Another problem is, that udev seems to ignore the /etc/hotplug/blacklist

... i should search in howtos about "ignore_devices" rules for udev ...

So udev ignores the NOT autoloading of ipw3945 which leads to

```
# dmesg | grep ipw

ipw3945: no version for "ieee80211_wx_get_encodeext" found: kernel tainted.

ipw3945: Intel(R) PRO/Wireless 3945 Network Connection driver for Linux, 1.0.5mpr

ipw3945: Copyright(c) 2003-2006 Intel Corporation

ipw3945: Detected Intel PRO/Wireless 3945ABG Network Connection
```

this error messages seems not to be serious, because after starting the ipw3945d wlan is working.

And it seems to be easy to find the "new" wlan device (because eth1 is used by "wired lan" after updgrading udev):

in /etc/udev/rules.d/

a file called 70-persistent-net.rules was created:

```
# PCI device 0x8086:0x4222 (ipw3945)

SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:13:02:17:41:da", NAME="eth2"
```

... so even i could recognize the new device name ...

... a ln -s /etc/init.d/net.eth0 /etc/init.d/net.eth2

changing the /etc/conf.d/net and everything worked again ...

----------

## wynn

 *anz wrote:*   

> a ln -s /etc/init.d/net.eth0 /etc/init.d/net.eth2

 net.eth2 should be linked to net.lo otherwise you are storing up trouble for yourself in the future.

Does RC_PLUG_SERVICES="!net.eth0" in /etc/conf.d/rc do the right thing?

----------

## anz

Dear wynn,

thanks alot - in future I will link always from net.lo to net.ethX

and RC_PLUG_SERVICES="!net.eth0" in /etc/conf.d/rc lets disappear the firewire-over-internet.

THANK YOU!!!

----------

## Aszrael

 *anz wrote:*   

> 
> 
> and RC_PLUG_SERVICES="!net.eth0" in /etc/conf.d/rc lets disappear the firewire-over-internet.
> 
> 

 

unfortunately not - it is still sitting there [see "ifconfig -a"]

only good thing: it will not be started during init and cause problems with dhcp

@anz: 70-persistent-net.rules was not created on my system   :Confused: 

Like jcat I'm also looking for a way to get rid of this firewire-device 

still no clue anyone?

Aszrael

----------

## jcat

 *anz wrote:*   

> Dear wynn,
> 
> thanks alot - in future I will link always from net.lo to net.ethX
> 
> and RC_PLUG_SERVICES="!net.eth0" in /etc/conf.d/rc lets disappear the firewire-over-internet.
> ...

 

Ok, this is a good start.  I can use /etc/conf.d/rc to stop the ethernet script trying to start the firewire port as a network device.  But first I want to make my primary NIC eth0 again.  Once I have sorted out my udev rules I'll post back with the solution.

Cheers,

jcat

----------

## wynn

There's a good step-by-step guide by peenie Broken eth0 coldplugging config, maybe. [SOLVED] (Posted: Wed Sep 20, 2006 2:21 am) which you may find useful.

----------

## jcat

Ok, more research, and I think I have this sorted now.

Udev defaults to setting the firewire port as net.eth0 because there is no name specified in a rule, and that's how the kernel is addressing it by default, so it's called eth0.  Even if you create a udev rule specifying that the ethernet card should be eth0, it doesn't get that name.  You have to specify a different name for the firewire device to stop this behaviour, via the udev rules.

I have removed this udev rule

```
 # cat 70-persistent-net.rules.old 

# PCI device 0x10de:0x00df (forcedeth)

SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:04:61:92:87:52", NAME="eth1"
```

and added in two new ones

```
 # cat 01-firewire.rules 

KERNEL=="eth*" SUBSYSTEM=="net" ATTR{address}=="00:04:61:00:00:0b:63:8f" NAME="1394_0"

 # cat 02-nic.rules 

KERNEL=="eth*" SUBSYSTEM=="net" ATTR{address}=="00:04:61:92:87:52" NAME="eth0"
```

Then I just had to sort out the crazy auto net.eth0 initialization before it's specified in the init scripts.  I did this by modifying the previously mentioned /etc/conf.d/rc:

Leave coldplug behaviour

```
RC_COLDPLUG="yes"
```

and block eth0

```
RC_PLUG_SERVICES="!net.eth0" 
```

Everything normal again now.   :Cool:   And I learned a few lessons on the way.  Thanks guys!   :Smile: 

Cheers,

jcat

----------

## jcat

Hmmmm, seems like I still have a slight issue.

I get a udev error on boot:

```
rename_netif: error changing net interface name eth1_rename to eth0: No such device
```

Everything seems to be working ok, but it's starting to annoy me now!   :Wink: 

Cheers,

jcat

----------

## anz

thats a super solution:

```
 # cat 01-firewire.rules

KERNEL=="eth*" SUBSYSTEM=="net" ATTR{address}=="00:04:61:00:00:0b:63:8f" NAME="1394_0" 
```

... and the udev error during the boot process speeds up the "Letting udev process events" (because of the error)   :Wink: 

... so we learn more and more about udev ...

----------

## jcat

It's strange, my error comes and goes.  Sometimes it's their when I boot, and sometimes not.  There's nothing wrong AFAIK but it's nice to know why things are happening.

...and I must say, the more I learn about udev, the more I like it.   :Smile: 

Cheers,

jcat

----------

## AnalogKid

I am having the same issue.  I unmerged coldplug, emerged udev.  I also removed coldplug from rc-update.  All was fine until I restarted the machine, now I have no network connection.

ifconfig -a shows 3 entries:

eth0

eth1

lo

eth0 is the one that was configured to begin with.

I am getting a few errors on boot:

```
*Starting udev ...

udev[3447]: add_to_rules: invalid KERNEL operation

udev[3447]: add_to_rules: invalid rule '/etc/udev/rules.d/30-svgalib.ru
```

Later on in the boot process after lo is started...I get

```
INIT: Entering runlevel: 3

*WARNING: /etc/init.d/coldplug missing; skipping ...
```

Then eth0 is started

I'm not really sure where to start.  There are alot of things people have posted to "try" but I'm not sure which one to follow.  I am a noob to this so please go easy.

----------

## wynn

Did you run etc-update (or dispatch-conf) after emerge'ng udev?

----------

## AnalogKid

 *wynn wrote:*   

> Did you run etc-update (or dispatch-conf) after emerge'ng udev?

 

Yes: etc-update

----------

## wynn

 *AnalogKid wrote:*   

> 
> 
> ```
> *Starting udev ...
> 
> ...

 Here, this rule is

```
KERNEL=="svga*", NAME="%k", MODE="0660", GROUP="video"
```

Have you got a double "==" after "KERNEL"? *AnalogKid wrote:*   

> Later on in the boot process after lo is started...I get
> 
> ```
> INIT: Entering runlevel: 3
> 
> ...

 It looks as though coldplug is still in one of the runlevels

```
rc-update show|grep coldplug
```

should show you and you can remove it.

Can you also do

```
lsmod|grep 1394
```

 to see if you have a FireWire port which the kernel is enabling an Ethernet driver for (eth1394).

----------

## AnalogKid

 *wynn wrote:*   

>  *AnalogKid wrote:*   
> 
> ```
> *Starting udev ...
> 
> ...

 

30-svgalib.rules:

```
KERNEL="svga*", NAME="%k", MODE="0660", GROUP="video"
```

Should it have "=="?

rc-update show|grep coldplug:

```
* Broken runlevel entry: /etc/runlevels/default/coldplug
```

This is a link correct?  Can I just rm coldplug?

```
lsmod|grep 1394:

eth1394     19716   0

ohci1394    32176   0

ieee1394    91704   3   eth1394,sbp2,ohci1394
```

----------

## jcat

Yes you need ==, it's a mathematical way of expressing "exactly the same as", = is just "equivalent to".

to remove coldplug from the default runlevel, yes it is just a symbolic link, but there is a command line utility to help you...

```
rc-update del coldplug default
```

Cheers,

jcat

----------

## AnalogKid

 *jcat wrote:*   

> Yes you need ==, it's a mathematical way of expressing "exactly the same as", = is just "equivalent to".
> 
> to remove coldplug from the default runlevel, yes it is just a symbolic link, but there is a command line utility to help you...
> 
> ```
> ...

 

Ok I added the extra "="

and I had already done

```
rc-update del coldplug
```

but did not do the default at the end.  I did it again with the default and now the link is gone.

Restarted the computer and did not get the errors on boot, but still no network connection.   :Mad: 

Any other ideas?

----------

## jcat

You'll probably find that eth0 is now your firewire port, and eth1 is your ethernet port.

you can check this with

```
ifconfig -a
```

Please post the results.

Cheers,

jcat

----------

## AnalogKid

 *jcat wrote:*   

> You'll probably find that eth0 is now your firewire port, and eth1 is your ethernet port.
> 
> you can check this with
> 
> ```
> ...

 

I had to type this, so sorry if any typos.

There is also similar output for eth1 and lo, do you need me to post those?

```
eth0   Link encap:UNSPEC   HWaddr 00-40-D0-12-22-A0-FB-15-00-00-00-00-00-00-00-00

   inet addr:192.168.1.111 Bcast:192.168.0.255 Mask 255.255.255.0

   UP BROADCAST RUNNING MULTICAST MTU:1500 METRIC:1

   RX packets:0 errors:0 dropped:0 overruns:0 frame:0

   TX packets:164 errors:0 dropped:0 overruns:0 carrier:0

   collisions:0 txqueuelen:1000

   RX bytes:0 (0,0,b)   TX bytes:5904 (5.7 kb)
```

----------

## jcat

Ok, we can see from this

```
eth0   Link encap:UNSPEC   HWaddr 00-40-D0-12-22-A0-FB-15-00-00-00-00-00-00-00-00
```

that the HWaddr is not a normal mac address, this is almost definately your firewire card.  I would bet that the HWaddr for eth1 is a shorter number, hopefully the ethernet cards MAC address.

So, to get you back online, you just need to:

```
ln -s /etc/init.d/net.lo /etc/init.d/net.eth1
```

alter /etc/conf.d/net so that any eth0 references are changed to eth1, then

```
/etc/init.d/net.eth1 start
```

Then try and

```
ping google.com
```

That should get you going, then we can talk about re-ordering things back to normal again.

Cheers,

jcat

----------

## AnalogKid

I did notice that that was not a normal MAC address...

Anyway I changed 2 lines in /etc/conf.d/net to eth1

Started eth1...got no errors, but a message saying

 *Quote:*   

> * You are using a depreciated configuration syntax for eth1
> 
> * You are advised to read /etc/conf.d/net.example and upgrade it accordingly
> 
> Bringing up eth1
> ...

 

Still no network connection

The lines in /etc/conf.d/net that are NOT commented out are:

```
iface_eth1="192.168.1.111 broadcast 192.168.0.255 netmask 255.255.255.0"

...

...

gateway="eth1/192.168.1.3"
```

----------

## jcat

Can you ping 192.168.1.3 ?

Cheers,

jcat

----------

## AnalogKid

 *jcat wrote:*   

> Can you ping 192.168.1.3 ?
> 
> Cheers,
> 
> jcat

 

nope

 *Quote:*   

> Destination Host Unreachable

 

----------

## AnalogKid

Weird...

Before I tried stopping and starting eth1 and no network.

I rebooted and now it works!!

So now what do I need to do to re-order eth1 and 2?

I don't need the firewire port on this machine at all

----------

## Lloeki

 *Quote:*   

> 
> 
> I don't need the firewire port on this machine at all

 

then don't build eth over ieee1394 (or even all of ieee1394) in kernel  :Wink: 

generally speaking, you can rename ifaces with udev like this:

```
$ cat /etc/udev/rules.d/06-netif.rules 

KERNEL=="eth*",SYSFS{address}=="00:18:de:28:e0:96",NAME="wlan0"

KERNEL=="eth*",SYSFS{address}=="00:15:c5:3e:b0:7b",NAME="eth0"
```

watch out, it is case sensitive.

and be aware that the renaming will only be successful if the target name is free. if it is occupied, the name will be "${previousname}_rename" (e.g renaming eth1 to eth0 but eth0 already used gives eth1_rename as a name)

----------

## jcat

You need to write some udev rules.  The best thing to do is read this..

http://reactivated.net/writing_udev_rules.html

then look at my previous post in this thread, post 8, where I detail the rules I removed and added.  Also the /etc/conf.d/rc changes I made to prevent devices being started without init scripts.

EDIT:  Just saw Lloeki's post, yes you could remove some of the features from the kernel, but you never know maybe you'll need to use ethernet over firewire one day (ehhem   :Wink:  ).  If you configure it similarly to my post 8 config you'll always have the option, but still retain the setup they way you'd like it.

PLEASE MAKE SURE YOU READ THE UDEV GUIDE, It's good to get your head around these things.

Cheers,

jcat

----------

## AnalogKid

I will give this a try a bit later, but I really appreciate your help with this.

Thank you!

----------

## xiber

 *jcat wrote:*   

> 
> 
> ```
> rename_netif: error changing net interface name eth1_rename to eth0: No such device
> ```
> ...

 

I get the same error message but it dosen't seem to affect the boot process, the interface renaming nor interface operation.  In my case, getting blacklisting to work with the new udev would be better.

----------

## dmpogo

More I read recent discussions about udev-103,  more I'm getting firm in the opinion that it is time to get rid of udev completely on my machines  :Smile: 

----------

## devsk

udev-103 is total crapshot here. I can never guarantee that my NIC will get eth0 interface name every time I modprobe forcedeth. I have blacklisted the eth1394 module. I have !net.eth0 in RC_PLUG. I have created 01-firewire.rules containing my eth1394 interface and it gets created correctly when I load eth1394 module with modprobe. But I won't get eth0 for my NIC every time.

Here is what's happening:

There is a rules file 75-persistent-net-generator.rules which appends to 70-persistent-net.rules the new interfaces it finds. I did 

```
for i in 1 2 3 4 5 6 7 8 9 1 1 2 2 3 3 4 5 53 1  2 33 4 54;do rmmod forcedeth;modprobe forcedeth optimization_mode=0;ifconfig -a | grep "D7:C8:4D";sleep 3;done
```

it kept on creating interfaces upto "eth35" and adding one line rule to 70-persistent-net.rules (it will keep growing if I were to keep running it). Randomly it will reuse eth0 but when it will use eth0 and when ethXX, totally no guarantees (although its always sequentially increasing number).

Only solution was to remove the files 75-persistent-net-generator.rules, 70-persistent-net.rules and reload rules. Does anybody know what's going on?

----------

## jcat

Hi,

Did you also create the 02-nic.rules

```

cat 02-nic.rules 

KERNEL=="eth*" SUBSYSTEM=="net" ATTR{address}=="00:04:61:92:87:52" NAME="eth0"
```

Make sure you use the "udevinfo" command to get the correct values from the /sys/ directories for your udev rules.  Udev was a pain in the arse when I first switched to it from coldplug, but it works really nice once you have the rules sorted.   :Cool: 

Cheers,

jcat

----------

## devsk

my problem was that 70-persistent-net.rules was getting appended with ethXX containing a new rule for everytime I tried to modprobe forcedeth. The first 70-persistent-net.rules already had a rule for eth0. It then kept adding one rule for eth1, eth2, eth3 and so on.

----------

## jcat

Oh, ok, sorry   :Cool:    I thought you were having hard time getting eth0 to be your first ethernet device 100% of the time.  That's where my rule 2 comes in.

Cheers,

jcat

----------

