Ubuntu system network troubleshooting method

  • 2020-05-10 23:25:09
  • OfStack

1. First of all, the reasons for not connecting with wifi are as follows

        1. Network card problems

          2, no network driver installed

          3, network driver installed, but not loaded into the kernel

          4. If all the above are ok, then internet is not connected to the router

Next, step by step, 1

2. Check your network card information

You can use the following command to view the network card information


$ lshw -C network

Normally, at least two network CARDS will be displayed, 1 eth0 and 1 wlan0. Run this command, my computer situation is: two network CARDS description After the fields unclaim , and there is no logical name.

Based on the results of this command, the following conclusions can be drawn

        1, there is no problem with the network card

        2. Considering the ability to connect wifi before, there must be a network driver in the system

3. Whereas the network card information is identified as" unclaim ", the network driver should not be running, that is, not loaded into the kernel

So, the next step is to find the driver associated with the network card and load it into the kernel

3. Look for network card drivers

Run the following command


 $ vim /etc/udev/rules.d/70-persistent-net.rules

The results are as follows


# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="54:53:ed:31:c3:29", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x168c:0x0032 (ath9k)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:3e:8e:d8:10:95", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

From here we know that the drivers of eth0 and wlan0 are r8169.ko and ath9k.ko, respectively

Check whether the above driver module is running


$ lsmod | grep "ath9k"

Found no output for this proof module ath9k.ko Not loaded

Now check to see if the module is actually already in the system


$ find / -name "ath9k.ko"

The results for


/lib/modules/3.13.0-32-generic/kernel/drivers/net/wireless/ath/ath9k/ath9k.ko
/lib/modules/3.13.0-79-generic/kernel/drivers/net/wireless/ath/ath9k/ath9k.ko
/usr/lib/debug/lib/modules/3.13.0-79-generic/kernel/drivers/net/wireless/ath/ath9k/ath9k.ko

The above description module ath9k.ko It does exist! But wait, the first two up here ath9k.ko Are under different kernel modules, i.e 3.13.0-32-generic and 3.13.0-79-generic Under. At this point, let's look at the following kernel versions of the current system


$ uname -r

The results show that


3.13.0-92-generic

So far, it's clear that there is a wireless card driver module in our system. ath9k.ko , but not in the currently running kernel version! There are two solutions

        1. In the current kernel version, download the corresponding ath9k.ko , and through the unclaim0 Command to install

        2 3.13.0-79-generic version

Since not only the wireless module is not loaded here, eth0 module is not loaded here, so I guess it is caused by an error in the process of upgrading the system to 3.13.0-92. Therefore, I choose to back the system here.

4. System rollback

Because it already exists on the system 3.13.0-79-generic , so there is no need to download, install

Modify the boot startup option


$ vim /boot/grub/grub.cfg

In the open file, there are many menuentry, each menuentry corresponds to one option in the boot menu, found 3.13.0-79-generic Kernel corresponding to menuentry, determine its position sequence number, the first menuentry position is 0, incremented by 1.

Then change /etc/default/grub In the GRUB_DEFAULT The value is the serial number

The last run update-grub , as well as reboot Can be

conclusion


Related articles: