首先,将wifi的usb模块插入机器中,
然后通过lsusb命令来查看:
Bus 001 Device 004: ID 03f0:241d Hewlett-Packard Gobi 2000 Wireless Modem (QDL mode)
Bus 001 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 413c:2107 Dell Computer Corp.
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
我们可以查看到:
Bus 001 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
然后通过ifconfig命令,没有发现新的网卡模块,因此需要对其进行驱动安装:
# ifconfig
docker0 Link encap:Ethernet HWaddr 56:84:7a:fe:97:99
inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
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:65536 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1184 (1.1 KB) TX bytes:1184 (1.1 KB)
p32p1 Link encap:Ethernet HWaddr 00:0b:ab:7f:6f:2b
inet addr:192.168.1.118 Bcast:255.255.255.255 Mask:255.255.255.0
inet6 addr: fe80::20b:abff:fe7f:6f2b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10626 errors:0 dropped:0 overruns:0 frame:0
TX packets:9968 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10923798 (10.9 MB) TX bytes:1095709 (1.0 MB)
这个realtek的wifi模块,
这个时候我们需要安装驱动,根据其名称RTL8188CUS可以在其官网上找到我们需要的驱动:
由于我们采用的是ubuntu server,属于unix(linux)版本中的驱动,点击复杂下载链接,然后我们登录到server中,通过wget即可下载:
#wget ftp://WebUser:wK9xBuD5@58.211.24.153/cn/wlan/RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip
--2015-04-27 18:44:25-- ftp://WebUser:*password*@58.211.24.153/cn/wlan/RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip
=> ‘RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip’
Connecting to 58.211.24.153:21... connected.
Logging in as WebUser ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /cn/wlan ... done.
==> SIZE RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip ... 9855632
==> PASV ... done. ==> RETR RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip ... done.
Length: 9855632 (9.4M) (unauthoritative)
100%[======================================>] 9,855,632 332KB/s in 31s
2015-04-27 18:44:58 (310 KB/s) - ‘RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip’ saved [9855632]
对于zip文件,我们需要对zip文件进行解压缩,可以通过apt源安装unzip来进行解压缩:
# apt-get install unzip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
zip
The following NEW packages will be installed:
unzip
0 upgraded, 1 newly installed, 0 to remove and 164 not upgraded.
Need to get 157 kB of archives.
After this operation, 391 kB of additional disk space will be used.
Get:1 http://ftp.sjtu.edu.cn/ubuntu/ trusty-updates/main unzip amd64 6.0-9ubuntu1.3 [157 kB]
Fetched 157 kB in 0s (5,429 kB/s)
Selecting previously unselected package unzip.
(Reading database ... 61849 files and directories currently installed.)
Preparing to unpack .../unzip_6.0-9ubuntu1.3_amd64.deb ...
Unpacking unzip (6.0-9ubuntu1.3) ...
Processing triggers for mime-support (3.54ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up unzip (6.0-9ubuntu1.3) ...
然后通过如下命令进行解压缩:
unzip RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip
然后解压后运行install.sh,
遇到如下报错:
make[2]: *** [/home/omnilab/RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911/driver/rtl8188C_8192C_usb_linux_v4.0.2_9000.20130911/os_dep/linux/os_intfs.o] Error 1
make[1]: *** [_module_/home/omnilab/RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911/driver/rtl8188C_8192C_usb_linux_v4.0.2_9000.20130911] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-24-generic'
make: *** [modules] Error 2
##################################################
Compile make driver error: 2
Please check error Mesg
##################################################
然后google之,
apt-get install iw hostapd
然后ifconfig wlan0 up
查看
ifconfig
docker0 Link encap:Ethernet HWaddr 56:84:7a:fe:97:99
inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
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:65536 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1184 (1.1 KB) TX bytes:1184 (1.1 KB)
p32p1 Link encap:Ethernet HWaddr 00:0b:ab:7f:6f:2b
inet addr:192.168.1.118 Bcast:255.255.255.255 Mask:255.255.255.0
inet6 addr: fe80::20b:abff:fe7f:6f2b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:58547 errors:0 dropped:0 overruns:0 frame:0
TX packets:43405 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:61395274 (61.3 MB) TX bytes:5420812 (5.4 MB)
wlan0 Link encap:Ethernet HWaddr e8:4e:06:1b:f7:f2
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
然后参考文章:
http://jingyan.baidu.com/article/a24b33cd4bc58019ff002b49.html
即可制作成功。