Linux пропал сетевой интерфейс

Missing eth0 Ethernet interface in Ubuntu — can’t connect to router

I’m having trouble getting my Ubuntu 10.04 machine (Sony Vaio VGN-SR490) to connect to the Internet by way of an Ethernet cable connected directly to my router. I’m able to connect to the Internet using this same cable using a Windows machine, so there’s something wrong with the way Linux is configured. How do I got about figuring out what the problem is and solving it? Here are my network settings on Linux:

$ ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 vmnet1 Link encap:Ethernet HWaddr 00:50:56:c0:00:01 inet addr:192.168.79.1 Bcast:192.168.79.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 vmnet8 Link encap:Ethernet HWaddr 00:50:56:c0:00:08 inet addr:192.168.192.1 Bcast:192.168.192.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 
Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : [removed by me]. Link-local IPv6 Address . . . . . : [removed by me] IPv4 Address. . . . . . . . . . . : 192.168.1.103 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1 

I censored my IP address from these results. If that information is needed, just let me know. Here is the content of /etc/network/interfaces :

auto lo iface lo inet loopback 
$ sudo ifup eth0 Internet Systems Consortium DHCP Client V3.1.3 Copyright 2004-2009 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ SIOCSIFADDR: No such device eth0: ERROR while getting interface flags: No such device eth0: ERROR while getting interface flags: No such device Bind socket to interface: No such device Failed to bring up eth0. 
$ sudo modprobe msk FATAL: Module msk not found. $ dmesg | grep eth 

I removed Linux from my computer and installed Windows XP, at the request of some of the people commenting on this question. I installed an ran a program to find out details about the network card. Here is that information:

Network You are not connected to the internet Computer Name NetBIOS Name JOE-LAPTOP DNS Name joe-laptop Domain Name joe-laptop Remote Desktop Console State Active Domain joe-laptop RDP-Tcp State Listen WinInet Info An internal error occurred. Wi-Fi Info Wi-Fi not enabled WinHTTPInfo WinHTTPSessionProxyType No proxy Session Proxy Session Proxy Bypass Connect Retries 5 Connect Timeout 60000 HTTP Version HTTP 1.1 Max Connects Per 1.0 Servers INFINITE Max Connects Per Servers INFINITE Max HTTP automatic redirects 10 Max HTTP status continue 10 Send Timeout 30000 IEProxy Auto Detect No IEProxy Auto Config IEProxy IEProxy Bypass Default Proxy Config Access Type No proxy Default Config Proxy Default Config Proxy Bypass Adapters List Network Shares No network shares 

It looks like the network adapters list is empty. I will now install both Windows XP and Ubuntu Linux dual-boot. I’m still not able to access the internet, even through Windows. I’m wonder if this could be a hardware problem with the computer or a problem with the router itself. Other computers can connect to this same router, and work fine. (That’s how I’m posting this after all!)

Читайте также:  На чем сделан линукс

Источник

Пропал интерфейс 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.

Читайте также:  7zip linux command line

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.

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.

Читайте также:  Hp laserjet m1005 linux driver

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