找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 16038|回复: 71

[N1盒子] N1 盒子 Ubuntu 3.14 内核开启无线热点 + 配置 dnsmasq 解析自定义域名

  [复制链接]
发表于 2018-10-8 16:50 | 显示全部楼层 |阅读模式
本帖最后由 jshensh 于 2018-10-11 15:44 编辑

研究了好久。。终于把无线热点开起来了

1. 先开启 3.14 内核无线模块
  1. modprobe dhd && echo dhd >> /etc/modules
复制代码

2. 由于和后续的 dnsmasq 冲突,需要关掉系统自带的 systemd-resolved 服务
  1. systemctl stop systemd-resolved
  2. systemctl disable systemd-resolved
复制代码

3. 安装要用的 dnsmasq 和 net-tools 组件
  1. apt install dnsmasq net-tools
复制代码

4. 下载并安装 create_ap 工具
  1. git clone https://github.com/oblique/create_ap
  2. cd create_ap/
  3. make install
复制代码

5. 将以下内容保存至 /usr/bin/startap 。注意别忘了修改 YourSSIDHere YourPasswordHere 两个参数。如果有需要使用 2.4GHz 网络的,请去掉 --freq-band 5 --ieee80211ac 参数
  1. #!/bin/bash

  2. nohup /usr/bin/create_ap wlan0 eth0 YourSSIDHere YourPasswordHere --freq-band 5 --ieee80211ac --no-virt > /dev/null 2>&1 &
复制代码

随后执行
  1. chmod +x /usr/bin/startap
复制代码

6. 最后添加开机自启动项,将以下内容保存至 /usr/lib/systemd/system/ap.service
  1. [Unit]
  2. Description=ap
  3. After=network.target

  4. [Service]
  5. Type=forking
  6. ExecStart=/usr/bin/startap
  7. PrivateTmp=true

  8. [Install]
  9. WantedBy=multi-user.target
复制代码
并执行
  1. chmod +x /usr/lib/systemd/system/ap.service
  2. systemctl enable ap
  3. systemctl start ap
复制代码


这是在 5GHz 下的测速结果

2.4GHz

有线





由于日常开发使用 .test 域名进行测试,所以需要在 N1 上做个劫持,有需要的可以看看

1. 清空 /etc/resolv.conf 内容
2. 编辑 /etc/resolvconf/resolv.conf.d/head 文件,修改为
  1. nameserver 127.0.0.1
复制代码

3. 编辑 /etc/dnsmasq.conf 文件,在最后插入
  1. strict-order
  2. listen-address=127.0.0.1,192.168.12.1

  3. address=/.test/192.168.12.1

  4. resolv-file=/etc/resolv.dnsmasq.conf
复制代码

4. 将以下内容保存至 /etc/resolv.dnsmasq.conf
  1. nameserver 119.29.29.29
复制代码

5. 编辑 /etc/default/dnsmasq,将 IGNORE_RESOLVCONF=yes 前的注释去掉
6. 重载 dnsmasq
  1. /etc/init.d/dnsmasq reload
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

评分

参与人数 2恩山币 +3 收起 理由
hcyme + 2 面对这种帖子,我内心复杂,真不知道说什么好……
vistal + 1 DEBIAN 下不可以 ,试了很多了 郁闷 。。人品问题吗

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
发表于 2018-10-8 16:53 | 显示全部楼层
技术贴 真大佬 哈哈
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 17:09 | 显示全部楼层
绝世好文,不得不顶
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 17:38 | 显示全部楼层
闲置的N1可以发挥些作用了。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 17:50 | 显示全部楼层
厉害了  我的哥
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 18:04 | 显示全部楼层
没有N1 也帮顶下!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 18:15 | 显示全部楼层
n1刷乌班图是做什么用啊

点评

跑 lnmp 做服务器用  详情 回复 发表于 2018-10-8 18:31
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 18:19 | 显示全部楼层
不知道是干什么
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-10-8 18:31 来自手机 | 显示全部楼层
小白学技术 发表于 2018-10-8 18:15
n1刷乌班图是做什么用啊

跑 lnmp 做服务器用

点评

怪不得这么多人学这个玩意儿  详情 回复 发表于 2018-10-8 19:48
兄弟,3.14有办法装入emmc又能干掉安卓分区吗?想象4.18那样能最大使用emmc空间  详情 回复 发表于 2018-10-8 19:17
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 19:17 来自手机 | 显示全部楼层
jshensh 发表于 2018-10-8 18:31
跑 lnmp 做服务器用

兄弟,3.14有办法装入emmc又能干掉安卓分区吗?想象4.18那样能最大使用emmc空间

点评

我都是把 /dev/system 挂 /home  详情 回复 发表于 2018-10-9 08:29
可以手动删除安卓分区多出来1G空间  详情 回复 发表于 2018-10-9 00:41
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 19:20 来自手机 | 显示全部楼层
厉害了!能当路由器了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 19:21 来自手机 | 显示全部楼层
测速结果有信心
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 19:48 | 显示全部楼层
jshensh 发表于 2018-10-8 18:31
跑 lnmp 做服务器用

怪不得这么多人学这个玩意儿
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 20:56 | 显示全部楼层
学习,学习。谢谢分享!!!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-10-8 21:44 | 显示全部楼层
谢谢分享教程!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-24 09:10

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表