[转]在Ubuntu12.04上使用hostapd和dhcp3
来源:互联网 发布:centos 7安装mysql 编辑:程序博客网 时间:2024/05/16 06:28
[转]在Ubuntu12.04上使用hostapd和dhcp3
所需软件:
sudo apt-get install hostapd
sudo apt-get install dhcp3-server
1。新建hostapd.conf 文件,存放位置任意。
$ cat /etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
ssid=myAP
hw_mode=g
channel=10
macaddr_acl=0
auth_algs=3
wpa=2
wpa_passphrase=PassWord
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=TKIP CCMP
其中ssid指无线热点名字,wpa_passphrase指密码。
2。修改/etc/dhcp/dhcpd.conf,在末尾添加:
subnet 192.168.0.0 netmask 255.255.255.0
{
range 192.168.0.2 192.168.0.10;
option routers 192.168.0.1;
option domain-name-servers 8.8.8.8;
}
其中domain-name-servers后的8.8.8.8是可访问internet的eth0所使用的DNS,
可通过
nmcli dev list iface eth0 | grep IP4
获得。
3。启动hostapd
$ sudo hostapd -B /etc/hostapd/hostapd.conf
如果要重新启动需要先
$ sudo killall hostapd
4。设置无线网卡
$ sudo ifconfig wlan0 192.168.0.1 netmask 255.255.255.0
5。启动dhcp-server
$ sudo dhcpd wlan0 -pf /var/run/dhcp-server/dhcpd.pid
6。打开IP转发
sudo bash -c "echo 1 >/proc/sys/net/ipv4/ip_forward"
7。设置NAT
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
至此,无线热点设置完成。
- [转]在Ubuntu12.04上使用hostapd和dhcp3
- 在Ubuntu12.04上使用hostapd和dhcp3-server建Wi-Fi AP
- tftp 在ubuntu12.04, busyBox上的配置和使用
- 在Ubuntu12.04上使用gtest
- 在win10上使用VMware workstation安装ubuntu12.04
- 在Ubuntu12.04上安装postgresql9.1和postgis1.5
- 在Ubuntu12.04上安装postgresql9.1和postgis1.5
- ubuntu在使用hostapd配置无线AP
- 在Ubuntu12.04上安装mysql
- 在ubuntu12.04上安装Adobe Air
- 如何在Ubuntu12.04上安装CUDA
- 在Ubuntu12.04上安装中文输入法
- 在Ubuntu12.04LTS上安装RubyGem
- 在ubuntu12.04上编译 android源代码
- ecos在Ubuntu12.04上的安装
- 在ubuntu12.04上安装部署foreman
- 在Ubuntu12.04上部署BigBlueButton
- 分布式-在ubuntu12.04上安装mpi
- Oracle创建表、约束、视图、索引、序列、同义词、表空间
- hdu 1002 A + B Problem II
- 中国知网的“学术不端检测”
- 九度1468 Sharing
- memcpy惹的祸
- [转]在Ubuntu12.04上使用hostapd和dhcp3
- Ubuntu 12.04 the system is running in low-graphics mode
- C++关键字mutable
- SQLNET.AUTHENTICATION_SERVICES
- 基于LRU算法的缓存实现
- Ext动态树详解
- PHP 数组和字符串互相转换
- 递归
- hadoop单机版安装