LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Debian network cannot find eth after rebooting with new kernel (https://www.linuxquestions.org/questions/linux-networking-3/debian-network-cannot-find-eth-after-rebooting-with-new-kernel-4175718783/)

tiashi 11-14-2022 11:07 PM

Debian network cannot find eth after rebooting with new kernel
 
hi friends, I'm a newbee on kernel so I was trying to compile a new kernel.

I was doing that on a bandwagonhost vps and the compiling went well. then I just update-grub and the new kernel was shown on grub after rebooting. There was no panic and I accessed with the new kernel.

The tricky thing was that, after going into with the new kernel, I noticed the VM cannot be accessed via ssh. I checked the sshd service was good and the ssh port was open.

During that time, I checked ifconfig -a and found the eth. I thought it was the new kernel thing, so I switched back to the old kernel. Then everything went wrong... I cannot find eth via ifconfig -a and the network was not working......

I googled it, but still not working... So I'm here asking for advice&guidance, pls help.

yvesjv 11-24-2022 12:32 PM

Try to have a look at the messages logged when the new kernel was booting up.
as root run this command:
dmesg | more

uteck 11-24-2022 05:41 PM

Do you know what type of VM your host is using? That might narrow down the module it uses for the network so you could try manually loading it with the modprobe command.

tiashi 12-07-2022 07:50 AM

1 Attachment(s)
Quote:

Originally Posted by yvesjv (Post 6394146)
Try to have a look at the messages logged when the new kernel was booting up.
as root run this command:
dmesg | more

hi yvesjv sorry for the late reply&thanks for the help. just ran dmesg | more and the logs are as follows.

Attachment 40007

Code:

[root /]# dmesg | grep eth
[    2.576285] virtio_net virtio5 ens18: renamed from eth0
[    2.592784] virtio_net virtio6 ens19: renamed from eth1

only saw the above log related to eth... don't know what else to do....

tiashi 12-07-2022 07:54 AM

Quote:

Originally Posted by uteck (Post 6394193)
Do you know what type of VM your host is using? That might narrow down the module it uses for the network so you could try manually loading it with the modprobe command.

hi uteck, thank you! I tried to manually modprobe the eth but with the following errs, does this mean I'm missing the eth config when compiling the kernel?

Code:

[root /]# dmesg | grep -I eth
[    2.576285] virtio_net virtio5 ens18: renamed from eth0
[    2.592784] virtio_net virtio6 ens19: renamed from eth1


[root /]# dmesg | grep -i eth
[    2.576285] virtio_net virtio5 ens18: renamed from eth0
[    2.592784] virtio_net virtio6 ens19: renamed from eth1


[root /]# lspci | grep -i net
00:12.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:13.0 Ethernet controller: Red Hat, Inc. Virtio network device


[root /]# modprobe eth0
==========================[STDERR]==========================
modprobe: FATAL: Module eth0 not found in directory /lib/modules/5.10.0-8-amd64
===========================[END]============================


Exit code: 1
[root /]# modprobe eth1
==========================[STDERR]==========================
modprobe: FATAL: Module eth1 not found in directory /lib/modules/5.10.0-8-amd64
===========================[END]============================


tiashi 12-07-2022 08:10 AM

actually 5.10.0-8-amd64 was my old kernel, I updated it to 6.1.0. but cannot modprobe eth0 on both of them, all with Module eth0 not found in /lib/modules

Code:

[root /]# modprobe eth0
==========================[STDERR]==========================
modprobe: FATAL: Module eth0 not found in directory /lib/modules/5.10.0-8-amd64
===========================[END]============================


Exit code: 1
[root /]# cd /lib/modules
[root /lib/modules]# ls
5.10.0-8-amd64
6.1.0-rc3+


[root /etc]# ifup eth0
==========================[STDERR]==========================
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Cannot find device "eth0"
Failed to get interface index: No such device

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug.  These pages explain the proper
process and the information we find helpful for debugging.

exiting.
ifup: failed to bring up eth0
===========================[END]============================


Exit code: 1


uteck 12-07-2022 09:02 AM

From your dmesg output, your system renamed eth0 to ens18 and eth1 to ens19. So the system is loading the modules for networking.
If you boot into the old kernel does the eth interfaces get renamed? Or yo can check in the ssh config and see if it is looking for a differently named network interface.

tiashi 12-07-2022 10:25 PM

Quote:

Originally Posted by uteck (Post 6396542)
From your dmesg output, your system renamed eth0 to ens18 and eth1 to ens19. So the system is loading the modules for networking.
If you boot into the old kernel does the eth interfaces get renamed? Or yo can check in the ssh config and see if it is looking for a differently named network interface.

thanks uteck!!! appreciate for your help. I misunderstood it, thought ens renamed to eth....

changed eth in /etc/network/interfaces to ens, then restarted the network.service and it's all good now. thanks again.

may I ask why it was renamed to ens? the old kernel also renames it, did I do anything wrong on grub config. should not relate to the kernel compiling config right?


All times are GMT -5. The time now is 11:07 AM.