博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ubuntu下设置一个wifi热点
阅读量:4103 次
发布时间:2019-05-25

本文共 1533 字,大约阅读时间需要 5 分钟。

我使用的是ap-hotspot,比较简单,命令行一共就三四步的样子。先来提一下配置的方法,然后讲我遇到的问题。

第一步:安装hoseapd和ap-hotspot。

sudo apt-get updatesudo apt-get install postapdsudo apt-get install ap-hotspot

第二步:配置ap-hotspot

sudo ap-hotspot configureDetecting configuration...Detected eth0 as the network interface connected to the Internet. Press ENTER if this is correct or enter the desired interface below (e.g.- eth0, ppp0 etc.)://什么也不输入,敲一下回车Detected wlan0 as your WiFi interface. Press ENTER if this is correct or enter the desired interface (e.g.- wlan1)://再敲一下回车Enter the desired Access Point name or press ENTER to use the default one (myhotspot)://输入wifi名称Enter the desired WPA Passphrase below or press ENTER to use the default one (qwerty0987)://输入wifi密码

第三步:热点启动

sudo ap-hotspot start

等到出现wireless hotspot active,这样一个wifi就启动了。

遇到的问题:
1、启动了以后进程一直阻塞着。
一直阻塞的话就是不成功,去/tmp/文件夹下查看hostapd的日志文件显示如下

Configuration file: /etc/ap-hotspot.conf                                                                                       nl80211: Could not configure driver modenl80211 driver initialization failed.hostapd_free_hapd_data: Interface wlan0 wasn't started

发现问题是nl80211后边这一串。解决办法是

//这两行的意思是先关闭wlan,然后关闭接口让ifconfig可以工作sudo nmcli nm wifi off sudo rfkill unblock wlan//用ifcongif升级wlan,然后允许一秒的延迟sudo ifconfig wlan0 10.15.0.1/24 upsleep 1//重启设备sudo service isc-dhcp-server restartsudo service hostapd restart

问题解决。

这几个命令要在普通用户下运行,sudo权限个root用户下运行并不一样。
2、启动了以后终端提示Another process is already running
这是因为已经启动过一遍了,再启动一遍就会提示这个错误。解决办法是去临时文件夹下删除hotspot.pid文件。

sudo rm /tmp/hptspot.pid

转载地址:http://vpbsi.baihongyu.com/

你可能感兴趣的文章
java中float和double的区别
查看>>
Statement与PreparedStatement区别
查看>>
Tomcat配置数据源步骤以及使用JNDI
查看>>
before start of result set 是什么错误
查看>>
(正则表达式)表单验证
查看>>
在JS中 onclick="save();return false;"return false是
查看>>
JSTL 常用标签总结
查看>>
内容里面带标签,在HTML显示问题,JSTL
查看>>
VS编译器运行后闪退,处理方法
查看>>
用div+css做下拉菜单,当鼠标移向2级菜单时,为什么1级菜单的a:hover背景色就不管用了?
查看>>
idea 有时提示找不到类或者符号
查看>>
JS遍历的多种方式
查看>>
ng-class的几种用法
查看>>
node入门demo-Ajax让前端angularjs/jquery与后台node.js交互,技术支持:mysql+html+angularjs/jquery
查看>>
神经网络--单层感知器
查看>>
注册表修改DOS的编码页为utf-8
查看>>
matplotlib.pyplot.plot()参数详解
查看>>
拉格朗日对偶问题详解
查看>>
MFC矩阵运算
查看>>
最小二乘法拟合:原理,python源码,C++源码
查看>>