linux -- 搭建wifi热点

[Lab]: Linux gnu 3.2.0-4-amd64 #1 SMP Debian 3.2.57-3+deb7u1 x86_64 GNU/Linux

安装 hostapd

不建议使用命令 sudo apt-get install hostapd 安装,部分Linux源中的hostapd版本较老,存在问题。wget http://w1.fi/releases/hostapd-2.2.tar.gz

tar xvf hostapd-2.2.tar.gz
cd ./hostapd-2.2/hostapd
make

编译完成后,查看hostapd信息
nixawk@gnu:~/hostapd-2.2/hostapd$ ./hostapd -h
hostapd v2.2
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2014, Jouni Malinen <j@w1.fi> and contributors

usage: hostapd [-hdBKtv] [-P <PID file>] [-e <entropy file>] \
         [-g <global ctrl_iface>] [-G <group>] \
         <configuration file(s)>

options:
   -h   show this usage
   -d   show more debug messages (-dd for even more)
   -B   run daemon in the background
   -e   entropy file
   -g   global control interface path
   -G   group for control interfaces
   -P   PID file
   -K   include key data in debug messages
   -t   include timestamps in some debug messages
   -v   show hostapd version
创建hostapd配置文件 /etc/hostapd/hostapd.conf
nixawk@gnu:~$ cat /etc/hostapd/hostapd.conf
#change wlan0 to your wireless device
interface=wlan0
driver=nl80211
bridge=br0
country_code=CN
ieee80211d=1
ssid=teeeeeeee
hw_mode=g
channel=6
wme_enabled=0
macaddr_acl=0
auth_algs=1

wpa=2
wpa_passphrase=123456789
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
配置网络接口,

nixawk@gnu:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo br0
iface lo inet loopback

# wireless wlan0
allow-hotplug wlan0
iface wlan0 inet manual

# eth0 connected to the ISP router
allow-hotplug eth0
iface eth0 inet manual

# setup birdge
iface br0 inet static
bridge_ports eth0 wlan0
address 192.168.1.11
netmask 255.255.255.0
network 192.168.1.0

## isp router ip, 192.168.1.1 also runs DHCPS ##
gateway 192.168.1.1
dns-nameservers 192.168.1.1
dns-search localdomain

# 配置完成, 请执行 /etc/init.d/networking restart 重新配置网卡接口

# 开启 wifi热点 teeeeeeee
./hostapd -dd /etc/hostapd/hostapd.conf


===========================================================

http://www.cyberciti.biz/faq/debian-ubuntu-linux-setting-wireless-access-point/
http://k16.ddtuangou.com/browse.php?u=B%2FvIfXM3CoXK7trOkBSgwc4z%2FD%2FOxk%2BjvuRIaX7neEqOiopnWI8pBJASpIerAE2emQyzpQt0WdiG93%2FhCg9Ahs8gAUrwu4qgmmU1tIt6pRRTwidc4z91vw%3D%3D&b=0&f=norefer
http://wireless.kernel.org/en/users/Documentation/hostapd
http://blog.csdn.net/lqrensn/article/details/8154558

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值