Hostapd implements WiFi hotspot (AP)

Source: Internet
Author: User
Document directory
  • In ubuntu, how does one obtain hostapd?
  • How to Use hostapd

In ubuntu or other similar Linux systems, hostapd can be used to achieve WiFi Wireless Access hotspot (AP)
To provide wireless Internet access to other devices, such as laptops and mobile phones. That is, the wireless routing function.
What is hostapd?
Hostapd is a daemon of user controls used for wireless access points (AP) and Authentication servers (Authentication servers ).
She implements AP management for, ieee802.1x/WPA/wpa2/EAP authorization, radius client, EAP server, and radius authorization server. Currently, the latest version supports Linux (host AP, madwifi, mac80211-based driver) and FreeBSD (net80211 ).
Hostapd is designed as a daemon (process) that runs in the background and performs related control and authorization operations. Is an open-source project.
Related links:

Http://w1.fi/hostapd/

Http://linuxwireless.org/en/users/Documentation/hostapd

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: 0000: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"  Revision: 0x01  Driver: "b43-pci-bridge"  Driver Modules: "ssb"  Device File: wlan0  Features: WLAN  Memory Range: 0xf3000000-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 10 11 12 13 14  WLAN frequencies: 2.412 2.417 2.422 2.427 2.432 2.437 2.442 2.447 2.452 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, active=unknown  Attached to: #16 (PCI bridge)

In ubuntu, how does one obtain hostapd?

1. Terminal Input

sudo apt-get install hostapd

2. Run the GIT command to get the latest version.

sudo apt-get install git-coregit clone git://w1.fi/srv/git/hostap.git

3. Select your desired version

http://w1.fi/hostapd/
How to Use hostapd

Decompress the obtained package and enter hostapd.

tar xzvf hostapd-x.y.z.tar.gzcd hostapd-x.y.z/hostapd

Copy a default configuration file

cp defconfig .config

Edit the. config file and find
# Config_driver_nl80211 = y
Change
CONFIG--DIRVIERNL80211
Final Compilation:
Sudo make
If an error occurs in the libnl library, install or upgrade the libnl library.
This library mainly provides Netlink protocol-related APS functions based on Linux kernel.
Download and obtain the required version above 0.8

http://www.infradead.org/~tgr/libnl/

If an error persists, install libssl-Dev:
This library provides an SSL Development Library

sudo apt-get install libssl-dev

After compilation, get the hostapd execution file.
How to Use hostapd?
The hostapd function, that is, the notebook is involved through a wired network port. hostapd uses the wireless network card of the notebook to implement wireless routing.
Edit the hostapd. conf file
Refer to here for your network card

http://linuxwireless.org/en/users/Documentation/hostap

A simple configuration file:

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

Build a bridge:

sudo apt-get install bridge-utils

Build a bridge:

sudo brctl adbr br0sudo ifconfig br0 192.168.2.236 netmask 255.255.255.0sudo route add default gw 192.168.2.254

Connect the two ends of the bridge:

sudo brctl addif br0 eth0sudo brctl addif br0 wlan0

Finally:

sudo ./hostapd hostapd.conf

If everything goes well, you will see similar words on the terminal:

root@wsn-laptop:/home/wsn/Desktop/hostapd-0.7.3/hostapd# ./hostapd hostapd.conf Configuration file: hostapd.confUsing interface wlan0 with hwaddr 00:22:5f:85:e7:a7 and ssid 'ubuntu-502d'

Enable wifi on Android phone and set static IP
For example, IP Address: 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.