Network is unreachable что за ошибка ubuntu

Обновлено: 04.07.2024

Today I restarted my linux box, and following the restart, my linux box has no network connection.

Here's what I've tried so far:

Use an different ethernet cable that works on my other computer. No change.

In NetworkManager (KDE) remove and re-create the wired network connection. Didn't work. I'm still getting system notifications in the lower right corner of the screen saying

Checked /etc/network/interfaces . The only code in there is what the internet says it's supposed to be:

Made sure it's not just a DNS issue by trying to ping one of google's public DNS servers

Doesn't appear to be a DNS issue.

NEW Fix routing. I used the route command to add a default gateway pointing to my router's IP address (thanks @chaos).

NEW See if I have an IP address

It looks like I have an IPv6 address but not an IPv4 address? I would expect eth0 to have a line starting with inet addr: , but it doesn't.

So how do I obtain an IP address?

Here's some more information that may (or may not) be helpful:

What should I do next?

5,217 10 10 gold badges 30 30 silver badges 48 48 bronze badges 233 1 1 gold badge 3 3 silver badges 8 8 bronze badges I would try booting from a CD and see if it connects, to make sure this is the Debian configuration that is at fault.

3 Answers 3

I would (all this commands as root) ifconfig -a to check if the interface has an IP address, if it doesn't you have found your problem, if it does, then I would netstat -rn to check if the routes are right. If they are, I would iptables -L to check if there is a firewall rule that is not letting me out. If they are all OK then maybe your IP address doesn't belong to the router network.

3,734 1 1 gold badge 13 13 silver badges 29 29 bronze badges Could you please indicate how to fix the problems, e.g. if the interface has no IP address or if the routes are wrong. What happens if you assign one manually and it still has no network access? (No cabling issues, ports work on other booted OSs)

connect: Network is unreachable points to a missing route to that network (the default route in this case).

To display the current routing table. There must be a route that looks like this:

Notice that, <gateway-ip> is the ip address of your router/gateway. And Iface may also be different, when you have multiple network interfaces in your system.

However, add the default route manually with this command:


44.3k 11 11 gold badges 108 108 silver badges 139 139 bronze badges My setup has no routes and when I tried to add a default route, I get an error SIOCADDRT: No such process

The issue here is that your wired interface (eth0) does not have an IPv4 address. You have manually added an IPv4 route but, without having an IPv4 address, traffic cannot get routed as it cannot assign an IP address for (your system's) source IP.

Without knowing more information of your environment (Are you using a DSL connection? Are you in an corporate network? Who should be providing you an IP address?) I would guess that before the reboot you either have a staticly configured IP address or a working DHCP server. If you had a staticly configured address (which your configuration does not show) it was lost after the reboot.

You see an IPv6 address because that address is "auto-configured". Since you have not configured it the wired interface just creates one that can be used to communicate with the local network.

From the ifconfig information you provided it seems that your network card is receiving Ethernet packets, but not sending any. Strangely, it is also showing many dropped packets.

For starters, I would suggest you do the following:

Get information of your network IP addressing scheme. Ask your network administrator, or check the information provided by your ISP. Alternatively, (if you are bold) you can listen to the network traffic on the network by running tcpdump -ni eth0 and try to guess your internal network addressing based on the packets your system receives.

From now on lets assume that your network is in a private IP address range, since this is quite common. Many networks nowadays are pre-configured in the 192.168.1.0/24 space range which means that the IP addresses start in 192.168.1.1 and end in 192.168.1.254

Configure your network interface with a static IP address and a gateway using either Network Manager (i.e. through the desktop) or configuring /etc/network/interfaces properly. This is described fully here in the Debian Wiki.

Note: You can also configure it manually running ip addr add 192.168.1.15 dev eth0; ip route add default via 192.168.1.1 . But this will not survive a system reboot.

Try to see if you reach the gateway by sending it packets. This can be done simply, assuming your gateway is 192.168.1.1 by running ping -c 10 192.168.1.1 . If the command returns that all 10 tests worked OK then you can see your gateway.

Then try to access a well known public IP address. For example a Google DNS server, doing ping -c 10 8.8.8.8 . If this does not work then try to run a tracing test using traceroute -n 8.8.8.8 to see where your packets are being dropped.

If all goes well up to step 5 I would suggest that, in order to diagnose future problems, you install the ifupdown-extra package. This installs the network-test tool which does many of the network tests listed above (and more) in order to diagnose if there is a network problem or misconfiguration.

Once you can connect using a static IP address. Try to go back with what you previously had which probably was a dynamic IP configuration using DHCP.

Reconfigure the interface to use a dynamic IP address.

Wait for Network Manager to do its job. You will see in your Desktop environment if it fails (or not) but you can also get detailed information in the System logs. More specifically /var/log/syslog . Filtering for Network Manager logs will tell you quite a lot of information, just run grep NetworkManager /var/log/syslog and review the output.

Run network-test to see if you are properly connected

If you are not connected to the network try to manually ask for an IP address running dhclient eth0 and see if that provides you with an IP address.

Based on the above tests you should have a better knowledge of what broke and what works in your network and configure your system accordingly.

После пяти неудачных установок Arch Linux у меня есть две, которые установлены правильно. В первый раз сеть работала нормально, и я даже устанавливал Arch Linux поверх SSH.

Я попытался установить Arch снова, потому что ничто в Интернете, казалось, не решало мою проблему. После установки я получаю ту же проблему.

Похоже, он не запускает eth0, потому что время ожидания истекло.

@uzsolt Да, выдает сбой вызова метода: Нет такого файла или ошибка каталога. Я также разместил тему на официальных форумах, я буду публиковать ответ здесь, если я найду один. ifconfig eth0 up уже сделано? Линукс видит вашу сетевую карту (модуль загружен)? Прежде всего, пожалуйста systemctl stop netctl-eth0.

Проблема, с которой я столкнулся, заключалась в том, что не было eth0 (насколько я понимаю). Запустите команду ip link , это должно вывести ваши интерфейсы. У меня не было eth0 интерфейса. Вместо этого я имел enp1s8 .

Поскольку я использовал static, я скопировал пример профиля с cd /etc/netctl тогда cp examples/ethernet-static my-network . После этого я редактировал my-network с nano my-network , и изменил интерфейс от eth0 до en1s8 (или любой другой адаптер в ip link ). Наконец, я позволил ему использовать этот профиль при запуске с netctl enable my-network .

Включение профиля гарантирует, что он запускается при загрузке, но нет необходимости перезагружать систему, просто запустите netctl start my-network ее для немедленной инициализации.

Мне удалось получить помощь на официальных форумах Arch Linux, вы можете посмотреть мою тему там .

Сеть недоступна означает, что у вас нет маршрута к сети. Если вы не можете даже пропинговать локальный маршрутизатор, либо у вас нет IP-адреса, либо ваш сетевой интерфейс не работает.

netctl это стандартная утилита для управления сетевыми интерфейсами в Arch. Если вы не настроили это (или что-то еще), у вас не будет никакой сети. Даже не DHCP.

Я скопировал файл примера из examples / ethernet-static в «my-network», изменил этот файл, затем включил его при запуске с «netctl enable my-network». В сети также отсутствуют конфликты IP-адресов. Это должно быть "Настроить" Чтобы узнать, можете ли вы подключиться к шлюзу по умолчанию (это часто ваш маршрутизатор), введите ip route . Если окажется, что у вас нет шлюза по умолчанию, вы должны добавить его либо для DHCP, либо с помощью ip route add default via xxx.xxx.x.xxx . Чтобы сделать шлюз по умолчанию постоянным, добавьте IP к /etc/network/interfaces .

Одно важное уточнение ответа с наибольшим количеством голосов - перезапуск НЕТ. Если присутствует только сетевой интерфейс и правильное имя интерфейса и конфигурации, используемые в файле профиля в / etc / netcl (пусть копия примера называется mynet1), то

запустит сетевой профиль mynet1 и сетевой маршрут будет работать.

позволит системной службе запускаться диспетчером службы systemd при каждой загрузке, т. е. он создаст файл модуля в /etc/systemd/system/netc@[mynetprofilename].service с подробной информацией о модуле (привязка устройства и зависимость).

Также обратите внимание, что если сетевой профиль будет изменен, он должен быть netctl reenable'd.

Archlinux говорит, попробуйте dhcpcd, если ваш установщик не может подключиться автоматически. Это сработало на месте для меня ПОСЛЕ установки. Просто введите «dhcpcd» в качестве команды, подождите несколько секунд, а затем «ip route» или «ping 8.8.8.8», чтобы проверить, работает ли он. Я даже использовал «смотреть IP-адрес», чтобы увидеть, как быстро появляются эти адреса inet и inet6.

Вместо использования dhcpcd я также могу подключиться с нуля с помощью:

e1000e является «сетевым драйвером», сообщает modinfo. Загружая этот модуль, я получаю ссылку на eth0 (нет, не ищите ее в / dev). Команды «ip» активируют ссылку, выбирают адрес и определяют локальную (подсеть), а затем шлюз по умолчанию. Мне потребовалось довольно много времени, чтобы проверить это (справка по IP-ссылке, справка по IP-адресу, справка по IP-маршруту . ).

Так что это поучительно, но «dhcpcd» быстрее печатать и, возможно, более надежно. И вы можете остановить это чисто с "dhcpcd -x".

С рабочим пингом и списком зеркал в /etc/pacman.d/ у вас есть все, что вам нужно для pacman или pacstrap.

.16 в моем адресе это просто любой (бесплатный) номер, и 192.168.0.1 всегда должен быть шлюзом. Возможно, мне повезло, но это хорошая новость, что вы можете взломать systemd и inet6. Я попробую netctl, хотя.

И сейчас я загрузился с systemd и запустил dhcpcd. Я получил адрес .15 на «eno1» и три адреса inet6, но, кроме того, результат такой же, как и в случае с хаком «ip».

This morning the networking in my Ubuntu 18.04 Server Edition is not working anymore :

sudo nano /etc/nework/interfaces :

Even with sudo /etc/init.d/networking restart:

What have I to do in order to make the network available again? Looking forward to your kind help Marco

I modified the /etc/network/interfaces file as follows:

But still no network.

For sudo llshw -c network : see above

5° Update : result of dpkg -l netplan

6° Update : sudo lshw -c network

Can I install netplan even if /dev/sdb1 might contain a corrupted superblock?

9° update: After modifying /etc/netplan/01-network-manager-all.yaml :

247 1 1 gold badge 5 5 silver badges 16 16 bronze badges May we see: ip addr show Please edit your question to show the result. @chili555 I updated my question shoing the result of : ip addr show Have you tried ifconfig eth0 up ? That is assuming ifconfig is installed. Kind of a hack, but what if you try editing the /etc/network/interfaces file and replace "eth0" with "enp3s0"? I say this because I am not seeing an eth0 interface at all in your output.

2 Answers 2

Your /etc/network/interfaces file should be:

Your /etc/netplan/*.yaml file should be:

and then you should execute:

Something is really strange with your computer.

the sudo lshw -C network command isn't giving a complete answer

unless it's a manual typo(s), the /etc/netplan directory and file contents are weird

netplan doesn't seem to be installed

You'd better check your file system before we reinstall netplan.

  • boot to a Ubuntu Live DVD/USB
  • open a terminal window by pressing Ctrl + Alt + T
  • type sudo fdisk -l
  • identify the /dev/sdXX device name for your "Linux Filesystem"
  • type sudo fsck -f /dev/sdXX , replacing sdXX with the number you found earlier
  • repeat the fsck command if there were errors
  • type reboot

Now edit your .yaml file and proceed with my original answer.

Rather than trying to patch together a botched server, I'd recommend just reinstalling the server at this point.


55.4k 8 8 gold badges 83 83 silver badges 134 134 bronze badges

Sounds similar to another post regarding a sudden unexpected network failure after everything was working fine for a long time.

Too often, the system updates automatically and the new updates are "allergic" to your existing chipsets (just made up the word "allergic" for bugs).

You may want to do the following to find your chipset

Then you may have to resort to a USB drive and SneakerNet to search for the latest driver for your chipset using another computer or mobile device. I also have a USB ethernet dongle that often saves me from SneakerNet in such situations by getting me back online so I can work and also download drivers and utilities needed to get the onboard ethernet chipset working again.

image

Как известно, типичные РС-компьютеры собирают из весьма разношерстных компонентов — процессор от одного производителя, видеокарта от другого, звуковая карта от третьего. Темы про принтеры/сканеры/Wi-Fi адаптеры/TV-тюнеры просто кишат повсюду на форумах. Не добавляют оптимизма и вездесущие китайские производители, не особо-то стремящиеся к стандартизации. Перед операционной системой стоит непростая задача заставить работать согласованно все эти устройства.
Предлагаю вашему вниманию небольшой гайд по устранению типичных проблем в Linux.

Восстановление загрузчика

Что там у меня в жужжащей коробке?

Есть такие замечательные команды, как lspci и lsusb , которые покажут, какими же устройствами начинена ваша PCI шина и USB порты соответственно.
Вывод команды будет похож на такой:

Bus 001 Device 004: ID 03f0:2c17 Hewlett-Packard
Bus 004 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 002 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

Что бы узнать побольше о конкретном устройстве, есть опции -s и -v:

sudo lspci -s 03:00.0 -v
sudo lsusb -s 001:004 -v

image

где непонятные символы 001:004 — адрес устройства из вывода команды lspci или lsusb.
Если вы испытываете страх при взгляде на мигающий курсор в терминале, то можно воспользоваться пакетом Hardinfo

Ох уж эти иксы

Довольно часто бывает, что после окончания начальной загрузки вы лицезреете чёрный экран. Что случилось? Возможно, слетел видеодрайвер. Разумеется, для не искушённого пользователя лучше воспользоваться драйверами из репозиториев. Для того, чтобы войти в ваш любимый Gnome или KDE для запуска менеджера пакетов, нажмите Ctrl-Alt-F1, и вы попадёте в терминал. Зайдите с правами рута, и заставьте ваш Xorg заюзать VESA драйвера: команда dpkg-reconfigure xserver-xorg для дебиана/убунту, yast2 для SUSE, а там выбираете VESA-совместимую видеокарту. Или nano /etc/X11/xorg.conf, ищете там слово intel, nvidia и подобное в секции Driver и меняете на vesa. Далее запускаем иксы: kdm или gdm или startxfce4 и т.д. (по вкусу). Если экран и дальше чёрный, прибиваете иксы с помощью Ctrl-Alt-Backspace и смотрите, где кошка зарыта: cat /var/log/Xorg.0.log | grep EE и гуглите текст ошибки.

Для начала поговорим о беспроводной сети. Проверьте наличие сети с помощью команды ifconfig. Естественно, ваша точка доступа должна быть включена и настроена. Если в выводе команды отсутствует интерфейс, названный ath0 или wlan0, то нужно что-то делать. Есть такие замечательные драйвера, как madwifi. Инструкцию по установке можно найти там же. Если они не помогли, вам возможно поможет такая утилита, как NDISwrapper. Этот костыль позволит использовать виндовые драйвера для адаптеров беспроводной сети в линуксе.

sudo ndiswrapper -i /path/to/driver.inf

Потом загрузите модуль ndiswrapper: sudo modprobe -v ndiswrapper

Далее попробуем поднять сеть:

sudo ifconfig wlan0 up
sudo iwlist wlan0 scan

Если на первую команду система ругается вроде «Interface Doesn't Support Scanning», то вы неверно выбрали название интерфейса, или не тот драйвер. Вторая команда запустит поиск беспроводной сети.

Читайте также: