Linux系统设置WiFi热点

本文提供两种方法在Linux系统上创建WiFi热点。方法一通过安装hostapd并使用create_ap脚本实现;方法二利用ap-hotspot工具进行配置及管理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

方法一:

第一步:安装hostapd

      sudo apt-get install hostapd

第二步:安装创建热点脚本(下载地址:http://download.youkuaiyun.com/download/hanbo622/9553371

      进入create_ap-master目录直接make

第三步:创建热点

      create_ap wlan0 eth0 hanbo -w2 12345678 &

            create_ap:创建热点脚本

            wlan0:WiFi网卡

            eth0:有线网卡

            hanbo:热点名称

            -w2: 加密方式WPA2

            12345678:密码

            &:后台运行

 

方法二:

第一步:安装hostapd

      sudo apt-get install hostapd

第二步:安装ap-hotspot

      sudo apt-get install ap-hotspot

      注意:如果安装失败,执行如下语句再安装

            sudo add-apt-repository ppa:nilarimogard/webupd8

            sudo apt-get update

第三步:ap-hotspot使用说明

      start            start wireless hotspot               // 打开wifi

      stop            stop wireless hotspot               // 停止wifi

      restart         restart wireless hotspot           // 重启wifi

      configure    configure hotspot                     // 配置wifi

      debug         start with detailed messages   // dubug模式打开wifi,会显示一些详细的信息

第四步:AP配置

      sudo ap-hotspot  configure

            Detecting 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的密码

第五步:启动WiFi

      sudo ap-hotspot  start

          Starting Wireless Hotspot...
          Wireless Hotspot active 

注意:如果在调试过程中 ap-hotspot start 出现 “Another process is already running” 

            ap-hotspot stop 无效问题

           可以sudo rm /temp/hotspot.pid 删掉已启动的进程

附:

      如果执行 "sudo ap-hotspot  start"后出现 "Starting Wireless Hotspot..."不动了,就是hostapd出现了问题

下载源码编译安装:http://download.youkuaiyun.com/download/hanbo622/9556564 (版本:hostap-1-hostap_1_1.tar.gz)

      a、tar -xvf hostap-1-hostap_1_1.tar.gz

      b、cd  hostap-1-hostap_1_1/hostapd

      c、cp defconfig .config

      d、安装编译环境

            apt-get install libnl-dev libpopt-dev openssl libssl-dev build-essential

      e、make

      f、make install (此安装就是把hostapd和hostapd_cli放到了/usr/local/bin中)

      g、cp  hostapd  hostapd_cli  /usr/sbin (这是替换掉apt-get install hostapd安装的程序,建议使用)

 

 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值