Go to file
oblique 3db732ed50 Get the current channel with 'iw dev wlanN link'
With older versions of iw we can not get the channel that we
are currently associated with. So we cannot detect if we have
to fallback to that channel. Because of this, hostapd exits
with the following errors:

    Failed to set beacon parameters
    Interface initialization failed
    ap0: interface state UNINITIALIZED->DISABLED
    ap0: AP-DISABLED
    ap0: Unable to setup interface.
    hostapd_free_hapd_data: Interface ap0 wasn't started

A solution is to get the frequency from 'iw dev wlanN link' and
convert it to the channel number.

Fix #50
2014-10-01 12:04:57 +03:00
create_ap Get the current channel with 'iw dev wlanN link' 2014-10-01 12:04:57 +03:00
create_ap.service handle service's stop correctly 2014-08-17 04:22:23 +03:00
LICENSE Add BSD License 2013-12-04 15:14:15 +02:00
Makefile Makefile: copy create_ap.service only if /lib/systemd/system exists 2013-12-15 16:29:08 +02:00
README.md Reimplementation of 6a3e1d98 commit 2014-09-05 02:13:59 +03:00

Features

  • Create an AP (Access Point) at any channel.
  • Choose one of the following encryptions: WPA, WPA2, WPA/WPA2, Open (no encryption).
  • Hide your SSID.
  • IEEE 802.11n support
  • Internet sharing methods: NATed or Bridged or None (no Internet sharing).
  • Choose the AP Gateway IP (only for 'NATed' and 'None' Internet sharing methods).
  • You can create an AP with the same interface you are getting your Internet connection.
  • You can pass your SSID and password through pipe or through arguments (see examples).

Dependencies

General

  • bash (to run this script)
  • util-linux (for getopt)
  • hostapd
  • iproute2
  • iw
  • iwconfig (you only need this if 'iw' can not recognize your adapter)
  • haveged (optional)

For 'NATed' or 'None' Internet sharing method

  • dnsmasq
  • iptables

For 'Bridged' Internet sharing method

  • bridge-utils

Installation

Generic

git clone https://github.com/oblique/create_ap
cd create_ap
make install

ArchLinux (AUR)

yaourt -S create_ap

Gentoo

emerge layman
layman -o https://raw.githubusercontent.com/jorgicio/jorgicio-gentoo/master/jorgicio-repo.xml -f -a jorgicio-gentoo
emerge net-wireless/create_ap

Examples

No passphrase (open network):

create_ap wlan0 eth0 MyAccessPoint

WPA + WPA2 passphrase:

create_ap wlan0 eth0 MyAccessPoint MyPassPhrase

AP without Internet sharing:

create_ap -n wlan0 MyAccessPoint MyPassPhrase

Bridged Internet sharing:

create_ap -m bridge wlan0 eth0 MyAccessPoint MyPassPhrase

Bridged Internet sharing (pre-configured bridge interface):

create_ap -m bridge wlan0 br0 MyAccessPoint MyPassPhrase

Internet sharing from the same WiFi interface:

create_ap wlan0 wlan0 MyAccessPoint MyPassPhrase

Choose a different WiFi adapter driver

create_ap --driver rtl871xdrv wlan0 eth0 MyAccessPoint MyPassPhrase

No passphrase (open network) using pipe:

echo -e "MyAccessPoint" | create_ap wlan0 eth0

WPA + WPA2 passphrase using pipe:

echo -e "MyAccessPoint\nMyPassPhrase" | create_ap wlan0 eth0

Enable IEEE 802.11n

create_ap --ieee80211n --ht_capab '[HT40+]' wlan0 eth0 MyAccessPoint MyPassPhrase

Systemd service

Using the persistent systemd service

Start service immediately:

systemctl start create_ap

Start on boot:

systemctl enable create_ap

License

FreeBSD