Article Title: Experience wireless networks in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Today, I finally experienced the fun of using wireless networks in Linux. I am excited to record my footprints and hope it will be helpful to my friends.
Let's talk about your actual situation first. My notebook is Intel's 3945 Nic. The system is Debian, the installation source is unstable, and the kernel is 2.6.24.2 compiled by myself. Of course, the unstable source now has the 2.6.24 kernel, so there is no need to compile it by yourself. Here we have to talk about the Debian unstable source. Unstable is an unstable source, but it has never been unstable since it was used. Therefore, the unstable source is recommended for individual desktop users.
Your earlier wireless NIC Driver was compiled and installed using Debian's m-a driver compilation tool. I personally think this Driver Installation tool is really quite convenient. It can be said that it is a fool, it will not make people feel that there is too much pain in driver installation. However, after the free installation is successful, no chance of application is found. Originally, our school had a small wireless coverage and was unstable. The wireless Changyou experience was practically impossible.
Later, when the Linux kernel was upgraded to 2.6.24, I thought about upgrading it. Here, we have to complain about the Debian source. The software In Debian source is really conservative, that is, the source in unstable won't be updated with new software or the kernel in real time, of course, this is also for stability considerations. Since the source does not exist, you only need to compile it yourself. Of course, it is quite convenient to compile and install the kernel in the Debian system. Download the source code, unpack, compile, and install the package. Everything is done smoothly. With the new kernel, you also need to re-compile and install the wireless NIC Driver. I think that I am familiar with using m-a to compile the driver module, but the final result is that the compilation is not successful. How can this happen? Google it on the Internet. Since 2.6.24, 3945 wireless network card support has been built in the kernel. You do not need to compile and install the driver module of the previous version. Haha, this is the first time, saving the trouble of compiling and installing by yourself. This is really a good thing. Let's take a closer look at it and say there is no need to compile and install it by yourself. Just load the corresponding driver module and install a wireless tool. The wireless tool is also the wireless-tools, which provides some tools for wireless Configuration. The wireless driver module is iwl3945. Use lsmod to check whether the system is loaded. You have to use the modprobe tool to manually load the data. Run the command, but there is no corresponding driver module. Depressing. How can this happen?
When I was overwhelmed, I suddenly remembered that the kernel was not selected to support the 3945 wireless network card. Check the configuration file during kernel compilation. Then select the corresponding module support and re-compile and install it. Run the new kernel and restart it. Haha, you can see the loaded driver module.
The driver module is successfully installed. Next we will install the wireless tool:
| # Apt-get install wireless-tools |
Then let's take a look at our device situation:
Or use the iwconfig command.
In general, we will see such a device:
Eth0: This is our wired network card.
Wlan0: This is our wireless network card.
We also need to configure the corresponding wireless interface:
| # Vim/etc/network/interfaces |
For example, my configuration is as follows:
# Wireless wlan0 Iface wlan0 inet dhcp Wireless-essid "4F-1" |
Here, the specific wireless-essid section can be edited later, so that the following operations can be performed properly:
If the configuration file is not edited, an error without a network interface will occur.
After running this command, we can use the iwlist command to search for nearby wireless networks:
After you find the wireless network, you can use the iwconfig command to configure it:
| # Iwconfig wlan0 channel 1 essid "4F-1" |
The preceding command is run on me. We can change the parameter values of channel and essid based on the search results, then, write the corresponding essid parameter value to the wireless-essid section in our network configuration file. After saving and exiting, you can start the wireless NIC:
My configuration here is to use DHCP. After running this command, connect and assign an IP address. If everything is normal, we can enjoy the Internet through wireless.
That's all ~~ Enjoy it ~~
PS: I haven't experienced the successful wireless network for a long time after the installation is successful. Today I finally succeeded in the experiment, so I noted down the content. However, it has been a long time in the past, so it is inevitable to remember errors in some places. Thank you for your criticism. :)