confused by netbase/udev
I'm a bit confused about netbase and udev use im Angstrom.
Here's what i see:
I connect an USB-NIC.
/etc/udev/rules.d/70-persistent-net.rules is created:
# This file was automatically generated by the /lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. #
# You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key.
# USB device 0x:0x (MOSCHIP usb-ethernet driver)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:3b:04:02:ae", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
But the NIC is not comming up (no ip assigned via DHCP). :(
I disconnect the USB-NIC and reboot.
/etc/udev/rules.d/70-persistent-net.rules still exists with the mentioned content. Why?
I connect another USB-NIC.
/etc/udev/rules.d/70-persistent-net.rules is extended:
# This file was automatically generated by the /lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. #
# You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key.
# USB device 0x:0x (MOSCHIP usb-ethernet driver)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:3b:04:02:ae", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# USB device 0x:0x (pegasus)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:00:e8:00:0f:e0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
This NIC is also not coming up. :(
And for each new NIC another name is created?! :(
And here's what i like to see:
* Connect an USB-NIC should result in an DHCP-configured interface.
* Disconnect the USB-NIC remove all traces from the system.
Hope you can clear the mist in my head.
Steffen
Am Dienstag, den 09.02.2010, 12:23 +0100 schrieb Steffen Sledz:
Quoted 6 lines
I'm a bit confused about netbase and udev use im Angstrom. Here's what i see:
I connect an USB-NIC.
/etc/udev/rules.d/70-persistent-net.rulesis created:
[…]
Quoted 4 lines
And for each new NIC another name is created?! :(
And here's what i like to see:
* Connect an USB-NIC should result in an DHCP-configured interface.
Do you have it configured somewhere (for example in [2])? If not you can use a daemon like NetworkManager.
Quoted 1 line
* Disconnect the USB-NIC remove all traces from the system.
[1] is necessary because (at least under Debian (I cannot verify on Ångström right now)) you can set certain parameters in [2], i. e. if an interface should be configured statically or dynamically. You have to reference those devices with ethN (N ∈ ℕ) but without [1] they would be randomly enumerated. That is why [1] is needed.
[…]
I hope that helps.
Thanks,
Paul
[1] /etc/udev/rules.d/70-persistent-net.rules
[2] /etc/network/interfaces
Quoted 7 lines · Paul Menzel
Quoted 2 lines
And here's what i like to see:
* Connect an USB-NIC should result in an DHCP-configured interface.Do you have it configured somewhere (for example in [2])? If not you can use a daemon like NetworkManager.
...
[2]/etc/network/interfaces
It's the Angstrom standard configuration containing e.g.
# Wired or wireless interfaces
auto eth0
iface eth0 inet dhcp
iface eth1 inet dhcp
But i'm not sure what this part means (especially what means 'auto' here. Where can i found some documentation about the content of this config file. The busybox and ifup/ifdown manpages are not very helpful here. :(
And another problem is the mentioned naming. If every connected USB-NIC gets a new name i cannot refer to it in this config file.
Quoted 1 line
I hope that helps.
Just a tiny bit. ;-)
Steffen
Steffen Sledz <[email protected]> [2010-02-09 14:18:08]:
Quoted 9 lines
# Wired or wireless interfaces
auto eth0
iface eth0 inet dhcp
iface eth1 inet dhcpBut i'm not sure what this part means (especially what means 'auto' here. Where can i found some documentation about the content of this config file. The busybox and ifup/ifdown manpages are not very helpful here. :(
man 5 interfaces?
Quote:
" lines beginning with the word "auto" are used to identify the physical
interfaces to be brought up when ifup is run with the -a option. (This
option is used by the system boot scripts.) Physical interface names should follow the word "auto" on the same line. There can be multiple "auto" stanzas. ifup brings the named interfaces up in the order listed. "
Quoted 2 lines
And another problem is the mentioned naming. If every connected USB-NIC gets a new name i cannot refer to it in this config file.
You can get unique name/symlink using udev rule.
-- ynezz
Quoted 1 line · Petr Štetiar
man 5 interfaces?
Not at openSUSE. :(
But the internet found it for me. :)
Quoted 4 lines
Quoted 2 lines
And another problem is the mentioned naming. If every connected USB-NIC gets a new name i cannot refer to it in this config file.
You can get unique name/symlink using udev rule.
Do you have short pointer or example for me?
Steffen
Steffen Sledz <[email protected]> [2010-02-09 14:38:51]:
Quoted 5 lines
Quoted 2 lines · Petr Štetiar
You can get unique name/symlink using udev rule.
Do you have short pointer or example for me?
http://www.google.com/search?hl=en&q=rename+interface+udev
-- ynezz
Quoted 9 lines · Petr Štetiar
man 5 interfaces?
Quote:
" lines beginning with the word "auto" are used to identify the physical
interfaces to be brought up when ifup is run with the -a option. (This
option is used by the system boot scripts.) Physical interface names should follow the word "auto" on the same line. There can be multiple "auto" stanzas. ifup brings the named interfaces up in the order listed. "
OK, i try to solve one problem after the other. Let's accept that every new USB-NIC gets a new name for now (using a pool of interface names).
I've tried to create a /etc/network/interfaces which fits my wishes:
------------->snip<----------------
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# the loopback interface auto lo iface lo inet loopback
# interfaces to bring up at boot time auto eth0
# the onboard NIC iface eth0 inet dhcp
# interfaces to bring up when hotplugging allow-hotplug eth1 eth2 eth3 eth4 eth5 eth6 eth7 eth8
# additional USB-NIC's iface eth1 inet dhcp iface eth2 inet dhcp iface eth3 inet dhcp iface eth4 inet dhcp iface eth5 inet dhcp iface eth6 inet dhcp iface eth7 inet dhcp iface eth8 inet dhcp ------------->snip<----------------
This works fine when hotplugging, but the USB-NIC is not recognised when connected while booting up. :(
I tried to change the one line responsible for that to
auto eth0 eth1 eth2 eth3 eth4 eth5 eth6 eth7 eth8
This works better but leads to dirty errors messages while booting and shutdown for disconnected interfaces:
boot:
eth1: unknown interface: No such device
eth2: unknown interface: No such device
eth3: unknown interface: No such device
eth4: unknown interface: No such device
eth5: unknown interface: No such device
eth6: unknown interface: No such device
eth7: unknown interface: No such device
eth8: unknown interface: No such device
shutdown:
Deconfiguring network interfaces... cat: /var/run/udhcpc.eth0.pid: No such file or directory
cat: /var/run/udhcpc.eth1.pid: No such file or directory
eth1: unknown interface: No such device
cat: /var/run/udhcpc.eth2.pid: No such file or directory
eth2: unknown interface: No such device
cat: /var/run/udhcpc.eth3.pid: No such file or directory
eth3: unknown interface: No such device
cat: /var/run/udhcpc.eth4.pid: No such file or directory
eth4: unknown interface: No such device
cat: /var/run/udhcpc.eth5.pid: No such file or directory
eth5: unknown interface: No such device
cat: /var/run/udhcpc.eth6.pid: No such file or directory
eth6: unknown interface: No such device
cat: /var/run/udhcpc.eth7.pid: No such file or directory
eth7: unknown interface: No such device
cat: /var/run/udhcpc.eth8.pid: No such file or directory
eth8: unknown interface: No such device
done.
I'm not really happy with that. :(
Steffen
Quoted 7 lines · Steffen Sledz
I'm a bit confused about netbase and udev use im Angstrom.
Here's what i see:
I connect an USB-NIC.
/etc/udev/rules.d/70-persistent-net.rulesis created:
I ended up just removing the following files from my build, and now it works as I expect -- the first USB NIC is always eth0, etc.
70-persistent-net.rules
75-persistent-net-generator.rules
Cliff
Am Dienstag, den 09.02.2010, 16:38 +0100 schrieb Steffen Sledz:
Quoted 2 lines
Quoted 1 line · Petr Štetiar
man 5 interfaces?
[…]
Quoted 32 lines
OK, i try to solve one problem after the other. Let's accept that every new USB-NIC gets a new name for now (using a pool of interface names).
I've tried to create a
/etc/network/interfaceswhich fits my wishes:------------->snip<----------------
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)# the loopback interface auto lo iface lo inet loopback# interfaces to bring up at boot time auto eth0# the onboard NIC iface eth0 inet dhcp# interfaces to bring up when hotplugging allow-hotplug eth1 eth2 eth3 eth4 eth5 eth6 eth7 eth8# additional USB-NIC's iface eth1 inet dhcp iface eth2 inet dhcp iface eth3 inet dhcp iface eth4 inet dhcp iface eth5 inet dhcp iface eth6 inet dhcp iface eth7 inet dhcp iface eth8 inet dhcp ------------->snip<----------------
Quoted 2 lines
This works fine when hotplugging, but the USB-NIC is not recognised when connected while booting up. :(
Did you test this with both USB-NICs?
Quoted 37 lines
I tried to change the one line responsible for that to
auto eth0 eth1 eth2 eth3 eth4 eth5 eth6 eth7 eth8
This works better but leads to dirty errors messages while booting and shutdown for disconnected interfaces:
boot:
eth1: unknown interface: No such device
eth2: unknown interface: No such device
eth3: unknown interface: No such device
eth4: unknown interface: No such device
eth5: unknown interface: No such device
eth6: unknown interface: No such device
eth7: unknown interface: No such device
eth8: unknown interface: No such deviceshutdown:
Deconfiguring network interfaces... cat:/var/run/udhcpc.eth0.pid: No such file or directory
cat:/var/run/udhcpc.eth1.pid: No such file or directory
eth1: unknown interface: No such device
cat:/var/run/udhcpc.eth2.pid: No such file or directory
eth2: unknown interface: No such device
cat:/var/run/udhcpc.eth3.pid: No such file or directory
eth3: unknown interface: No such device
cat:/var/run/udhcpc.eth4.pid: No such file or directory
eth4: unknown interface: No such device
cat:/var/run/udhcpc.eth5.pid: No such file or directory
eth5: unknown interface: No such device
cat:/var/run/udhcpc.eth6.pid: No such file or directory
eth6: unknown interface: No such device
cat:/var/run/udhcpc.eth7.pid: No such file or directory
eth7: unknown interface: No such device
cat:/var/run/udhcpc.eth8.pid: No such file or directory
eth8: unknown interface: No such device
done.
Quoted 1 line
I'm not really happy with that. :(
How are your boot/init scripts activate the interfaces, i. e. what options to they pass to ifup?
I still suggest to use a daemon as NetworkManager which as far as I know compensate this flaw of udev and /e/n/i which were created when a system had no dynamically added (non-wifi) NICs.
Although I must admit that I find a use case that someone is changing the NICs not very common. Normally you get one and always use that device with this one. And if you change it you normally only have to edit /e/n/i once since from now on you will use the new device.
Thanks,
Paul
Quoted 5 lines · Cliff Brake
I ended up just removing the following files from my build, and now it works as I expect -- the first USB NIC is always eth0, etc.
70-persistent-net.rules
75-persistent-net-generator.rules
I believe that's what we want.
BTW, what's the best way to remove them from the build? Something like this in udev_141.bb?
do_install_append_hipox() {
rm -f {D}${sysconfdir}/udev/rules.d/75-persistent-net-generator.rules
}
Steffen