Edup8188cus can be used for free in Linux, and it is convenient to build a WiFi hotspot for network testing.
HOSTAPD is a hot-spot simulator running in user space that is easy to debug and record access logs, and WiFi debugging is quite useful.
Installing HOSTAPD
sudo apt-get install HOSTAPD
Note: The HOSTAPD installed in this way is version 2.1, because the version is too new to conflict with other drivers. Run the following instructions to resolve:
sudo nmcli nm wifi offsudo rfkill unblock WLAN
It can then be installed and used in the normal way (otherwise it will report the driver error, etc.).
The complete boot process, including the following (IP needs to be modified to its own):
#complete script to set the AP up now Is:sudo nmcli nm wifi offsudo rfkill unblock wlansudo ifconfig wlan0 10.15.0.1/24 up Sleep 1sudo service isc-dhcp-server restartsudo service HOSTAPD restart
Before using, remember to select Mount USB Device from the host menu of the virtual machine.
To view your wireless network card information:
#注意: 13.10 The previous version was HWInfo--netcard, and the new version became LSHW. $LSHW-C Network
To see if the AP feature is supported, if there is an AP, the description supports :
$ sudo apt-get install iw$ IW list
Install HOSTAPD, anyway, to indicate what package to install if you depend on it :
$ sudo apt-get install libnl1 libnl-dev libnl-doc$ sudo apt-get install libssl-dev$sudo apt-get Install Bridge-utils$sudo Apt-get Install Hostapd$sudo cp/usr/share/doc/hostapd/examples/hostapd.conf.gz/etc/hostapd/$sudo gzip-d/etc/ Hostapd/hostapd.conf.gz$sudo gedit/etc/hostapd/hostapd.conf
Hostapd.conf content is as follows:
Interface=wlan0bridge=br0driver=nl80211ssid=ssahw_mode=gchannel=11dtim_period=1rts_threshold=2347fragm_ Threshold=2346auth_algs=3wpa=1wpa_passphrase=12345678wpa_key_mgmt=wpa-pskwpa_pairwise=tkip CCMPrsn_pairwise= CCMP
Setting the NIC bridging mode
The following file is best backed up :
$sudo vi/etc/network/interfaces
Replace the contents of the following (172.16.16.178 is eth0 the original address, meaning br0 now become the host's external network card, eth0 is the port of the Br0 Bridge 1, so the br0 here is exactly the same as the eth0 set)
# interfaces (5) file used by Ifup (8) and Ifdown (8) Auto loiface lo inet loopbackauto br0iface br0 inet staticbridge_ports E Th0address 172.16.16.X # #这里是你的IPnetmask 255.255.255.0network 172.16.16.0broadcast 172.16.16.255gateway 172.16.16.G # # This is your gateway.
After editing is complete, save and execute the command:
$sudo/etc/init.d/networking Restart
It's better to reboot.
In fact, here the net should already pass, ping the operator's DNS server:
$ping 8.8.8.8
It should be shown to make sense. But :
$ping www.baidu.com
Should not be able to pass.
Reset DNS for Hosts
There is no change in/etc/resolve.conf, because there is no after reboot. The following file will not be removed after restarting.
$sudo Vi/etc/resolvconf/resolv.conf.d/tail
This file should not be saved by default.
NameServer 202.100.64.68
After saving ping www.baidu.com, should be able to pass.
Phone and computer eth0 settings
The computer side eth0 does not have to set the IP address. Delete the original settings.
Mobile phone side to manually set the IP address, 172.16.16.Y, the other settings are the same
Try, the phone should be able to surf the Internet.
Ubuntukylin 14.04 Configuration HOSTAPD Introduction