• 通过hostapd配置wifi热点 (可以连接,无法上网)


    仅个人记录,不建议参考

    用apt下载hostapd,dnsmasq

    插入网卡,不需要开启监听模式

    创建一个open.conf文件,写入

    interface=wlan0

    ssid=FreeWiFi

    driver=nl80211

    channel=1

    hw_mode=g

    其中,interface是无线网卡接口名称,ssid是热点名称,driver是无线驱动,channel是信道(1-13)。hw_mode是值无线模式,g表示IEEE 802.11g,视情况修改

    然后配置DHCP和DNS服务,这里我使用dnsmasq

    在/etc/dnsmasq.conf 中修改

    dhcp-range=192.168.229.100,192.168.229.250,12h

    interface=wlan0

     interface是无线网卡接口名称

    dhcp-range这个值来源于eth0的inet。

    但是目前是什么意思还没搞清楚,有可能就是这个值导致热点无法上网

    然后就是重启服务,

    systemctl restart dnsmasq

    如果出现这种报错

    Job for networking.service failed because the control process exited with error code.
    See "systemctl status networking.service" and "journalctl -xe" for details.

    就按提示输入systemctl status networking.service

    一步一步排查,有可能是文件什么地方写错了

    正常情况下重启服务后,

    再执行

    nmcli radio wifi off

    rfkill unblock wlan

    ifconfig wlan0 192.168.229.134

    hostapd open.conf

    不出意外就是这个样子

    然后就可以用手机连上这个wifi了。

    但是我这个样子配置,目前该wifi可以连上,但是没有网络

    待解决

     

  • 相关阅读:
    Http错误代码
    Android View自动生成插件
    【Android】设备标识
    【Android】键盘的展开和收起
    【Android】Activity生命周期(亲测)
    【Android】IntentService & HandlerThread源码解析
    【Android】与服务器实现JSON数据通信
    【Web】Eclipse + Maven + Struts搭建服务器
    【Android】Kill Service
    【Android】Handler、Looper源码分析
  • 原文地址:https://www.cnblogs.com/This-is-Y/p/12669291.html
Copyright © 2020-2023  润新知