HOSTAPD realize WiFi hotspot (AP)

Source: Internet
Author: User
Tags documentation unique id git clone
WiFi Wireless access hotspot (AP) is available on Ubuntu systems or other similar Linux systems using HOSTAPD
In order to provide other wireless access to the network of equipment, such as notebooks, mobile phones to achieve wireless internet function. It is also the function of no line.
What is HOSTAPD
HOSTAPD is the user control's daemon for wireless access points (APs) and authorization servers (authentication servers).
She implements IEEE802.11 AP management, ieee802.1x/wpa/wpa2/eap authorization, RADIUS clients, EAP servers, and RADIUS authorized servers, with the latest version supporting Linux systems (HOST Ap,madwifi, Mac80211-based drive) and FreeBSD (net80211).
HOSTAPD is designed as a daemon (process), running in the background, and doing some related control authorization. Belong to an open source project.
RELATED links:
http://w1.fi/hostapd/
Http://linuxwireless.org/en/users/Documentation/hostapd

To view your wireless network card information:

wsn@wsn-laptop:~$ hwinfo--netcard ... 28:PCI e00.0:0282 WLAN Controller [Created at pci.318] UDI:/org/freedesktop/hal/devices/pci_14e4_4315 Unique ID: Y9sn.reaas+k0ma5 Parent ID:hoOk.F8Gordq8HH2 SysFS ID:/devices/pci0000:00/0000:00:1c.2/0000:0e:00.0 SysFS busid:00 00:0e:00.0 Hardware class:network Model: "Dell Wireless 1397 WLAN mini-card" Vendor:pci 0x14e4 "Broadcom" Device : PCI 0x4315 "BCM4312 802.11b/g" Subvendor:pci 0x1028 "Dell" Subdevice:pci 0x000c "Wireless 1397 WLAN Mini-card" R EVISION:0X01 Driver: "B43-pci-bridge" Driver Modules: "SSB" Device file:wlan0 Features:wlan, Memory range:0xf
  3000000-0XF3003FFF (rw,non-prefetchable) irq:18 (557260 events) HW address:00:22:5f:85:e7:a7 Link Detected:yes WLAN channels:1 2 3 4 5 6 7 8 9 WLAN frequencies:2.412 2.417 2.422 2.427 2.432 2.437 2.442 2.447 2.457 2.462 2.467 2.472 2.484 WLAN encryption MODES:WEP40 WEP104 TKIP CCMP WLAN Authentication modes:Open Sharedkey Wpa-psk wpa-eap Module Alias: "pci:v000014e4d00004315sv00001028sd0000000cbc02sc80i00" Driver Info #0: Driver STATUS:SSB is active Driver activation CMD: "Modprobe SSB" Config status:cfg=new, Avail=yes, Need=no, AC Tive=unknown attached to: #16 (PCI Bridge)

under Ubuntu, how to get HOSTAPD. 1. Terminal input Life

sudo apt-get install HOSTAPD
2. The latest version is available through git command
sudo apt-get install git-core
git clone git://w1.fi/srv/git/hostap.git
3. Choose the version you want
http://w1.fi/hostapd/
How to use HOSTAPDUnpack the acquired packets and enter the HOSTAPD.
Tar xzvf hostapd-x.y.z.tar.gz
CD HOSTAPD-X.Y.Z/HOSTAPD
Copy a default configuration file
CP defconfig. config
Edit the. config file to find
#CONFIG_DRIVER_NL80211 =y
Amended to
config--dirviernl80211
Final compile:
sudo make
If you compile an error, many of the reasons are LIBNL library error, by installing or upgrading the LIBNL library
The library mainly provides NetLink protocol-related APS functions based on the Linux kernel.
Download here, request version more than 0.8
http://www.infradead.org/~tgr/libnl/
If there is an error, then you need to install Libssl-dev:
The library provides an SSL development library
sudo apt-get install Libssl-dev
After compiling, get HOSTAPD execution file.
How to use HOSTAPD.
HOSTAPD function, that is, notebook through the cable network intervention, HOSTAPD use the wireless card notebook, wireless routing.
Edit hostapd.conf File
Can be based on their own network card, reference here
Http://linuxwireless.org/en/users/Documentation/hostap
A simple configuration file:
Interface=wlan0
bridge=br0
driver=nl80211
ssid=ssa
hw_mode=g
channel=11
rts_threshold=2347
fragm_threshold=2346
auth_algs=3
wpa=1
wpa_passphrase=12345678
WPA_KEY_MGMT=WPA-PSK
wpa_pairwise=tkip CCMP
rsn_pairwise=ccmp
To build a network bridge:
sudo apt-get install bridge-utils
To establish a network bridge:
sudo brctl adbr br0
sudo ifconfig br0 192.168.2.236 netmask 255.255.255.0
sudo route add default GW 192.168.2.25 4
Connect both ends of the network bridge:
sudo brctl addif br0 eth0
sudo brctl addif br0 wlan0
At last:
sudo./HOSTAPD hostapd.conf
If all goes well, you will see a similar word at the end:
root@wsn-laptop:/home/wsn/desktop/hostapd-0.7.3/hostapd#./HOSTAPD hostapd.conf 
Configuration file: hostapd.conf
Using interface wlan0 with hwaddr 00:22:5f:85:e7:a7 and SSID ' ubuntu-502d '
Android phone opens WiFi and sets static IP
such as ip:192.168.3.75
Mask: 255.255.255.0
Network management: 192.168.3.1

That is, you can connect to a wireless hotspot named ubuntu-502.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.