Нет сетевого интерфейса linux

Ethernet Interface does not show after fresh installation of Ubuntu 20.04

I just installed Ubuntu 20.04 but my network interface does not show up. I already read several posts so I tried various answers to restart my network like sudo service network-manager restart , sudo ifconfig eno1 up . but nothing worked. The funny thing is that everything works fine if I just reboot the computer. So the drivers are available and the hardware is compatible. This is not a one time thing but I always need to power my PC (no internet), I reboot and I can access the internet without any problems. Below I added the output of some commands: ip addr (after first boot with no internet)

1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eno1: mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 14:da:e9:15:28:f9 brd ff:ff:ff:ff:ff:ff inet 192.168.2.7/24 brd 192.168.2.255 scope global dynamic noprefixroute eno1 valid_lft 86336sec preferred_lft 86336sec inet6 fe80::c162:e3cf:f06b:15e0/64 scope link noprefixroute valid_lft forever preferred_lft forever 
 *-network UNCLAIMED description: Ethernet controller product: 82579V Gigabit Network Connection vendor: Intel Corporation physical id: 19 bus info: pci@0000:00:19.0 version: 05 width: 32 bits clock: 33MHz capabilities: cap_list configuration: latency=0 resources: memory:fa600000-fa61ffff memory:fa628000-fa628fff ioport:f040(size=32) 
 *-network description: Ethernet interface product: 82579V Gigabit Network Connection vendor: Intel Corporation physical id: 19 bus info: pci@0000:00:19.0 logical name: eno1 version: 05 serial: 14:da:e9:15:28:f9 size: 1Gbit/s capacity: 1Gbit/s width: 32 bits clock: 33MHz capabilities: bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=0.13-4 ip=192.168.2.7 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s resources: irq:48 memory:fa600000-fa61ffff memory:fa628000-fa628fff ioport:f040(size=32) 
# Let NetworkManager manage all devices on this system network: version: 2 renderer: NetworkManager 
# interfaces(5) file used by ifup(8) and ifdown(8) # Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d 

Additional info: I had the same problem with Ubuntu 18.04 but I lived with it as I didn’t have the time for intensive troubleshooting. I just thought a fresh install and a new Ubuntu might do the trick, especially as Ubuntu 20.04 booted from USB directly uses the interface. But now with a fresh install, the problem persists and I’d like to get rid of it as it is really annoying. As requested: This is a desktop PC with a P8Z68-V PRO motherboard from ASUSTeK Computer INC. sudo dmidecode -s bios-version returns: 0501

Читайте также:  Manjaro linux vs fedora

Источник

Пропал интерфейс eth0

Просыпаюсь, включаю комп, не стартует сеть. Не понимаю, что такое? ifconfig говорит, что есть только интерфейс lo. Никаких обновлений ядра / дров / софта / чего угодно не было со вчера, когда всё работало. lspci контроллёр видит, лампочка горит. Сетевуха встроена в материнку.

Втыкание PCIшной сетевухи не помогло, с ней сеть точно так же не поднимается.

В первое сообщение темы помещу всякие результаты диагностики.

blackstar yura # ip link 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth1: mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000 link/ether cc:5d:4e:38:ed:84 brd ff:ff:ff:ff:ff:ff 3: eth0: mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000 link/ether 90:e6:ba:b9:55:2f brd ff:ff:ff:ff:ff:ff 4: sit0: mtu 1480 qdisc noop state DOWN mode DEFAULT link/sit 0.0.0.0 brd 0.0.0.0 
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03) Subsystem: ASUSTeK Computer Inc. M4A785TD Motherboard Flags: bus master, fast devsel, latency 0, IRQ 46 I/O ports at c800 [size=256] Memory at fafff000 (64-bit, prefetchable) [size=4K] Memory at faff8000 (64-bit, prefetchable) [size=16K] Expansion ROM at fbcf0000 [disabled] [size=64K] Capabilities: [40] Power Management version 3 Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+ Capabilities: [70] Express Endpoint, MSI 01 Capabilities: [ac] MSI-X: Enable- Count=4 Masked- Capabilities: [cc] Vital Product Data Capabilities: [100] Advanced Error Reporting Capabilities: [140] Virtual Channel Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00 Kernel driver in use: r8169 07:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) Subsystem: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ Flags: bus master, medium devsel, latency 64, IRQ 16 I/O ports at e800 [size=256] Memory at fbeffc00 (32-bit, non-prefetchable) [size=256] Capabilities: [50] Power Management version 2 Kernel driver in use: 8139too 
Bringing up interface eth0 /etc/init.d/net.eht0: line 555: _exists: команда не найдена ERROR: interface eth0 does not exist 

Источник

/etc/network/interfaces missing in Ubuntu [SOLVED]

If you are using Ubuntu, you must have encountered the » /etc/network/interfaces missing » error. Because Ubuntu 18.04 and above uses netplan to configure your network. The /etc/network/interfaces file is no longer available in newer versions. Netplan is used instead, the configuration file is in the /etc/netplan/ directory.

For example, let’s look under /etc/network on Ubuntu 22.04:

foc@ubuntu22:~$ ls /etc/network/ if-pre-up.d if-up.d
foc@ubuntu22:~$ cat /etc/network/interfaces cat: /etc/network/interfaces: No such file or directory

As you can see, there are no interfaces files. Let’s have a look under netplan:

foc@ubuntu22:~$ ls /etc/netplan 00-installer-config.yaml
foc@ubuntu22:~$ cat /etc/netplan/00-installer-config.yaml # This is the network config written by 'subiquity' network: ethernets: enp1s0: dhcp4: true version: 2 

Network configuration is in yaml file. So what should we do if we want to go back to the past? Can we use the /etc/network/interfaces file? Let’s see what we can do.

Читайте также:  Установить линукс с hdd

Network definition steps with /etc/network/interfaces

The following steps will now take you back to the past, Ubuntu only allows you to define networks in the old way.

Package Installation

In Ubuntu, two packages must be installed to configure the network settings in the interfaces file. Update the package list first:

foc@ubuntu22:~$ sudo apt update -y

Then install the packages:

foc@ubuntu22:~$ sudo apt install ifupdown net-tools

So what do these packages do?

  • ifupDown Package: It is used with the ifup and ifdown commands to configure (or deconfigure respectively) network interfaces based on the interface definitions in the /etc/network/interfaces file.
  • net-tools Package: It needs this package to form the base set of the NET-3 network distribution for Linux operating systems.

Configuring Grub

Network configuration should be translated to eth0 as in /etc/network/interfaces configurations.

In the /etc/default/grub file, the following lines are changed:

foc@ubuntu22:~$ sudo sed -i -e 's/GRUB_CMDLINE_LINUX=\"\"/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g' /etc/default/grub
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

Note: You can edit the /etc/default/grub file manually as above by opening it with a text editor (nano, vim etc).

foc@ubuntu22:~$ sudo update-grub Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file . Found linux image: /boot/vmlinuz-5.15.0-53-generic Found initrd image: /boot/initrd.img-5.15.0-53-generic Found linux image: /boot/vmlinuz-5.15.0-46-generic Found initrd image: /boot/initrd.img-5.15.0-46-generic Found memtest86+ image: /memtest86+.elf Found memtest86+ image: /memtest86+.bin Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. Check GRUB_DISABLE_OS_PROBER documentation entry. done 

Finally, reboot the operating system:

Output of » ip a » command when network is managed with netplan:

foc@ubuntu22:~$ ip ad 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp1s0: mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:c4:72:46 brd ff:ff:ff:ff:ff:ff inet 192.168.122.34/24 metric 100 brd 192.168.122.255 scope global dynamic enp1s0 valid_lft 2416sec preferred_lft 2416sec inet6 fe80::5054:ff:fec4:7246/64 scope link valid_lft forever preferred_lft forever

Output of » ip a » command when managed with interfaces file:

foc@ubuntu22:~$ ip a 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:c4:72:46 brd ff:ff:ff:ff:ff:ff altname enp1s0 inet 192.168.122.34/24 metric 100 brd 192.168.122.255 scope global dynamic eth0 valid_lft 3517sec preferred_lft 3517sec inet6 fe80::5054:ff:fec4:7246/64 scope link valid_lft forever preferred_lft forever

You can see that the » enp1s0 » interfaces name has changed to » eth0 «. Now let’s view the /etc/network/interfaces file:

foc@ubuntu22:~$ cat /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) # Include files from /etc/network/interfaces.d: source /etc/network/interfaces.d/*

Now the interfaces file is available in the system.

Читайте также:  Create user name linux

Create New Network Interface

Of course, the interfaces file should be defined when switching to the old system. Define the following lines in the interfaces file to get ip from DHCP:

foc@ubuntu22:~$ sudo vi /etc/network/interfaces auto eth0 allow-hotplug eth0 iface eth0 inet dhcp

First, the defined interface is down:

If a 2nd interface is not defined on the server, you may lose access to the server after this command. Either define a 2nd interfaces or have direct access to the server.

foc@ubuntu22:~$ sudo ifdown --force eth0 /etc/network/if-down.d/resolved: 12: mystatedir: not found 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/ Listening on LPF/eth0/52:54:00:c4:72:46 Sending on LPF/eth0/52:54:00:c4:72:46 Sending on Socket/fallback Created duid "\000\001\000\001+\033\306(RT\000\304rF".

interfaces

Then turn the interface up:

foc@ubuntu22:~$ sudo ifup eth0

As you can see in the picture above, the new interface has received an IP address.

Summary

In this article, we explained the steps to define the network with the interfaces file removed in Ubuntu 18.04 and later versions. Although the steps in the article provide you with this opportunity, the methods brought by the operating system will be more stable.

In a possible update and package conflict, the first settings to be changed will be those that the operating system does not support. Therefore, it will be useful to get used to netplan.

References

Didn’t find what you were looking for? Perform a quick search across GoLinuxCloud

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can either use the comments section or contact me form.

Thank You for your support!!

Источник

Оцените статью
Adblock
detector