[SOLVED] Slackware64-current: eth1 replaces eth0, but gets no IP address on new mainboard
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Slackware64-current: eth1 replaces eth0, but gets no IP address on new mainboard
Hi there,
I am not sure, if it is a Slackware-specific topic. If not, please, let me know, I'll then post this elsewhere.
System is Slackware64-current with all upgrades up to today.
Problem is:
Because a thunderbolt destroyed my mainboard I had it replaced. Not the system doesn't receive a dynamic IP address from the router anymore with DHCP at boot time. The reason seems to be that there is no interface eth0 anymore. I see messages that udev replaced it with eth1.
Code:
# dhcpcd eth0
err, eth0: ioctl SIOCGIFHWADDR: No such device
root@orion10:/home/alex# dmesg | grep -i eth
Driver 'st' needs updating - please use bus_type methods
Driver 'sd' needs updating - please use bus_type methods
Driver 'sr' needs updating - please use bus_type methods
forcedeth: Reverse Engineered nForce ethernet driver. Version 0.62.
forcedeth 0000:00:14.0: PCI INT A -> Link[LMAC] -> GSI 23 (level, low) -> IRQ 23
forcedeth 0000:00:14.0: setting latency timer to 64
forcedeth 0000:00:14.0: ifname eth0, PHY OUI 0x732 @ 1, addr 00:19:db:cf:36:79
forcedeth 0000:00:14.0: highdma pwrctl timirq gbit lnktim desc-v3
udev: renamed network interface eth0 to eth1
eth1: no link during initialization.
ADDRCONF(NETDEV_UP): eth1: link is not ready
eth1: link up.
ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
eth1: no IPv6 routers present
Now
Code:
# dhcpcd eth1
works, while
Code:
# dhcpcd eth0
gives me an error message:
Code:
err, eth0: ioctl SIOCGIFHWADDR: No such device
In another thread I found a hint to delete /etc/udev/rules.d/70-persistent-net.rules, which I did. This file contains a line referring to eth1. But after deleting it, restarting udev brought it back, again with eth1 instead of eth0.
No I wonder, what's the best way to get back the standard behaviour, i. e. getting an IP address from the router at boot time?
Change /etc/udev/rules.d/70-persistent-net.rules and write "eth0" instead of "eth1", then reboot. I'm not sure it will work, but it's just to try different things.
when experiencing peculiar events in a network after a thunderbolt as you write, I'd suggest to test if a switch or a router is damaged. A damaged switch can cause dhcp not to work properly.
Change /etc/udev/rules.d/70-persistent-net.rules and write "eth0" instead of "eth1", then reboot. I'm not sure it will work, but it's just to try different things.
This works, even without rebooting. I did:
Code:
# cd /etc/rc.d
# ./rc.inet1 stop
# ./rc.udev stop
# vim /etc/udev/rules.d/70-persistent-net.rules
Here I changed eth1 to eth0
I used ifconfig to ensure that there was now no active interface, except loopback. Which was the case, the computer had 127.0.0.1 for interface lo as its only IP address. Then:
Now, this seems to work. However, I'd still like to know where the automatically generated eth1 comes from, and why DHCPCD doesn't use it then, once it is detected and as there is no eth0.
when experiencing peculiar events in a network after a thunderbolt as you write, I'd suggest to test if a switch or a router is damaged. A damaged switch can cause dhcp not to work properly.
Markus
Switch/router was already replaced, the new device worked out of the box with all my other machines, so it's very unlikely that the problem is caused on the router side.
I'd still like to know where the automatically generated eth1 comes from, and why DHCPCD doesn't use it then, once it is detected and as there is no eth0.
When your computer boots, udev looks for a card definition in /etc/udev/rules.d/70-persistent-net.rules that matches your new NIC's MAC address. The very first time it will not find a line for the new NIC. Instead it finds the entry for your old card, and additionally udev sees that this old card was called "eth0".
Even though your old NIC no longer exists, udev has to pick "eth1" for your new card because "eth0" appears to be taken. For all udev knows, the old card may only be gone temporarily, so it will not mess with existing NIC configurations.
And your Slackware box will probably only have configuration data for "eth0" in the file '/etc/rc.d/rc.inet1.conf'. When the interface with name "eth1" becomes available, and that interface is not configured in the rc.inet1.conf file, Slackware will not bring it up.
Thanks, Eric, this explains part of it, but:
After deleting /etc/udev/rules.d/70-persistent-net.rules and restarting udev all traces of the old NIC should be wiped, right? But when I then re-start udev, the file is created anew, again with a reference to eth1.
Why does udev "think" that eth0 is taken? Where does it take this (wrong) information from?
There is still a gap in my understanding, it seems... Would be grateful, if you could help me to close it.
gargamel I think since the nic had already been setup as eth1 in the kernel, udev was pulling the same info to create /etc/udev/rules.d/70-persistent-net.rules. After you delete that file you need to reboot to clear the old info out of the kernel.
Thanks a lot, XGizzmo, that solved it!
1. Delet /etc/udev/rules.d/70-persistent-net.rules
2. Reboot
Now, just for curiosity: Where does the kernel take this information from, and how can it be changed at runtime?
It should be possible. Isn't runtime flexibility what udev (and hal) are all about? E. g., when I plug an external USB hard disk, it's detected and made available to users (depending on pre-defined rules). However, when an Ethernet adapter is replaced with another one, this principle does not seem to apply (of course, this is rarely done).
Now, just for curiosity: Where does the kernel take this information from, and how can it be changed at runtime?
This is done when the kernel module is loaded. In your case you could have rmmod the module for your nic and modprobe the module. But unless you need high uptime a reboot is just as easy.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.