create_ap

create a nat-ed wifi ap
git clone git://git.2f30.org/create_ap
Log | Files | Refs | README | LICENSE

commit ef86553238d2f74c0c3a634c6c3ab38c803e3594
parent 01abb28e2c94b59f39b2c54f9b5d2f7ab189c570
Author: Evert Heylen <evertheylen@gmail.com>
Date:   Sat, 14 Sep 2013 18:06:29 +0200

added option to make the AP hidden

Diffstat:
Mcreate_ap | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/create_ap b/create_ap @@ -18,6 +18,7 @@ usage() { echo " -w <WPA version> Use 1 for WPA, use 2 for WPA2, use 1+2 for both (default: 1+2)" echo " -g <gateway> IPv4 Gateway for the Access Point (default: 192.168.12.1)" echo " -d DNS server will take into account /etc/hosts (default: disabled)" + echo " --hidden Make the Access Point hidden (do not broadcast the SSID)" echo echo "Example:" echo " $(basename $0) wlan0 eth0 MyAccessPoint MyPassPhrase" @@ -27,7 +28,7 @@ get_macaddr() { ip link show "$1" | sed -n 's/.*ether \([0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]\) .*/\1/p' } -ARGS=$(getopt -o hc:w:g:d -l "help" -n $(basename $0) -- "$@") +ARGS=$(getopt -o hc:w:g:d -l "help","hidden" -n $(basename $0) -- "$@") [[ $? -ne 0 ]] && exit 1 eval set -- "$ARGS" @@ -35,6 +36,7 @@ CHANNEL=1 GATEWAY=192.168.12.1 WPA_VERSION=1+2 ETC_HOSTS=0 +HIDDEN=0 while :; do case "$1" in @@ -42,6 +44,11 @@ while :; do usage exit 1 ;; + --hidden) + shift + HIDDEN=1 + echo "ignore_broadcast_ssid="$HIDDEN + ;; -c) shift if [[ -n "$1" ]]; then @@ -102,6 +109,7 @@ channel=${CHANNEL} ctrl_interface=$CONFDIR/hostapd_ctrl ctrl_interface_group=0 +ignore_broadcast_ssid=$HIDDEN EOF if [[ -n "$PASSPHRASE" ]]; then @@ -172,3 +180,4 @@ echo $OLD_IP_FORWARD > /proc/sys/net/ipv4/ip_forward ip link set down dev ${WIFI_IFACE} ip addr flush ${WIFI_IFACE} exit 0 +