Debian network is unreachable

Debian network is unreachable

Я совершенно новый для сервера Ubuntu, и мне трудно подключить сервер к Интернету.

Сначала я запустил ping -n 8.8.8.8

Затем я запустил ifconfig

Вот вывод для sudo lspci -n

Сеть lshw-c возвращает

lsmod code вернул этот

Снова появляется больше, но он дает информацию о самом драйвере. Я знаю, что это работает, я использовал его. Я предполагаю, что моя сеть отключилась, когда я установил Ubuntu Server. Как включить его?

Я проверил, и интернет-кабель подключен к маршрутизатору D-link. Я также использовал этот же компьютер для доступа в Интернет, когда у меня был установлен Ubuntu Desktop, поэтому интернет работает.

1 ответ

Как видно из списка аппаратных средств, это устройство NetXtreme BCM5705_2 Gigabit Ethernet , для которого требуется драйвер Linux tg3 и прошивка. Прошивка не бесплатна, поэтому вам нужно установить пакет firmware-linux-nonfree , чтобы он работал.

  • Начните искать журналы с sudo tail -f /var/log/messages /var/log/syslog в один новый терминал. Здесь вы можете увидеть, что происходит с другими командами. Найдите строки с tg3 или firmware .
  • Установите пакет прошивки. Вам необходимо добавить multiverse (без ограничений в Debian) в /etc/atp/sources.list после слова universe , например universe multiverse .
  • После сохранения изменений сделайте sudo apt-get update; sudo apt-get install linux-firmware-nonfree . Дополнительную информацию смотрите в руководстве: man sources.list .
  • Запустите sudo modprobe -r tg3 , чтобы выгрузить драйвер, а затем sudo modprobe tg3 , чтобы загрузить драйвер, чтобы узнать, загрузится ли проперша встроенного программного обеспечения. Посмотрите на журнал, с которым вы начали смотреть ранее с помощью команды tail , чтобы узнать, что произойдет. Там должно быть установлено, что устройства установлены и что встроенное ПО установлено.
  • Если это работает, настройте сеть в /etc/network/interfaces и выполните sudo ifup eth1 или имя вашего устройства.

Короче говоря, у вас нет прошивки, необходимой для работы вашей сетевой карты. Прошивка для этой карты должна находиться в пакете firmware-linux-nonfree в разделе multiverse .

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

Читайте также:  Assassins creed odyssey википедия

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?

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.

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, 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:

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.

Читайте также:  Goo gl что это такое

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.

Finally, ensure that you can do DNS resolution properly by running host www.google.com or ping -c 10 www.google.com

Читайте также:  500 Пикселей сайт на русском

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.

I’ve been trying to solve this out by myself but is nearly impossible. the thing is that I have to PCs on the same network, one is running Windows (192.168.61.100) and the other one is running Debian (192.168.61.200). I added a static route to the one running W (route add -p 192.168.0.0 mask 255.255.255.0 192.168.60.254) and I perfectly can ping a PC with IP address 192.168.0.170 and viceversa from 192.168.61.100. The problem comes when I try to add the same static route to the one running Debian, when I try to do it I get: root@satv:/home/satv# route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.60.254 SIOCADDRT: Network is unreachable Here are some useful things:

ifconfig

route -n

ip route list

netstat -anr

Obviously I need to ping 192.168.0.170 from 192.168.61.200 and viceversa. Can anybody please helpme. I’ve been working on this for days and I’m very desperate. Thanks a lot in advance.

Ссылка на основную публикацию
Adblock detector