找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 35547|回复: 103

[N1盒子] N1外接USB网卡做主路由支持有线蓝牙WIFI【未完待续】

  [复制链接]
发表于 2018-11-29 22:54 | 显示全部楼层 |阅读模式




硬件:N1盒子一个,USB网卡一个【淘宝10块钱包邮的百兆乞丐版,还有15块钱的做工精细百兆版,40-50块钱的千兆版】
系统: Armbian_5.67_Aml-s9xxx_Debian_stretch_default_4.19.2_desktop_20181128系统安装过程请参考论坛教程。解决N1 的 4.1x的有线- 蓝牙- wifi驱动问题:

请参考yangxuan8282的帖子 https://www.right.com.cn/forum/f ... ewthread&tid=353806
yangxuan8282的 补丁下载地址

补丁安装,假设是新刻录的U盘系统。
1, meson-gxl-s905d-phicomm-n1.dtb,放到 /boot/dtb,然后编辑 /boot/uEnv.ini ,把 dtb_name=/dtb/meson-gxl-s905x-khadas-vim.dtb 这一行换成 dtb_name=/dtb/meson-gxl-s905d-phicomm-n1.dtb
2, BCM4345C0.hcd,用它替换 /lib/firmware/brcm/BCM4345C0.hcd 这个文件,
然后用安装 bluez 用 bluetoothctl 连接蓝牙
(我装的系统是没有BCM4345C0.hcd文件的,所以直接复制到
/lib/firmware/brcm/
Tips:
Armbian 安装完成之后可以通过命令armbian-config命令配置系统。CLI菜单里面包含了多语言,常用软件,硬件设置,基本上你能想到折腾的东西,都可以设置。
billy@billy-m3:~$ ssh billy@192.168.9.66
billy@192.168.9.66's password:
____  ___                  
/ ___|/ _ \__  ____  ____  __
\___ \ (_) \ \/ /\ \/ /\ \/ /
___) \__, |>  <  >  <  >  <
|____/  /_//_/\_\/_/\_\/_/\_\
                             

Welcome to ARMBIAN 5.67 user-built Debian GNU/Linux 9 (stretch) 4.19.2-aml-s9xxx   
System load:   3.19 3.03 2.15          Up time:       17 min                Local users:   2                    
Memory usage:  25 % of 1843MB         IP:            192.168.9.66 192.168.9.242
CPU temp:      61°C                  
Usage of /:    58% of 6.4G           

[ General system configuration (beta): armbian-config ]

Configured profile sync daemon with overlayfs.


通过 ethtool 设置关掉 flow control

root@aml:~# ethtool -s eth0 speed 1000 duplex full autoneg off   #duplex full 是全双工,autoneg off 是关闭自动协商

#开启BBR        
root@aml:~#  sysctl net.ipv4.tcp_congestion_control=bbr


返回值一般是:

net.ipv4.tcp_congestion_control = bbr

#检查是否开启BBR,返回值出现tcp_bbr 表示开启bbr成功
root@aml:~# lsmod | grep bbr
tcp_bbr                20480  1

sysctl net.ipv4.tcp_available_congestion_control
返回值一般为:
net.ipv4.tcp_available_congestion_control = bbr cubic reno
或者为:
net.ipv4.tcp_available_congestion_control = reno cubic bbr



root@aml:~# sysctl net.ipv4.tcp_congestion_control
返回值一般为:
net.ipv4.tcp_congestion_control = bbr


root@aml:~# sysctl net.core.default_qdisc
返回值一般为:
net.core.default_qdisc = fq

N1路由设置参考论坛网友一个大草包的帖子https://www.right.com.cn/forum/thread-365151-1-1.html

安装pppoeconf(拨号上网)
#apt install pppoeconf -y

安装isc-dhcp-server
#apt install isc-dhcp-server -y

修改/etc/default/isc-dhcp-server
#nano /etc/default/isc-dhcp-server
将INTERFACESv4=""修改为INTERFACESv4="eth0:0"
在INTERFACESv6=""的前面加个#,修改为#INTERFACESv6=""


备份/etc/dhcp/dhcpd.conf
#mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak


重建/etc/dhcp/dhcpd.conf
#nano /etc/dhcp/dhcpd.conf
内容如下:
option domain-name "phicomm-n1";
option domain-name-servers 192.168.1.2;
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.101 192.168.1.254;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.1.255;
    option routers 192.168.1.2;
    option domain-name-servers 192.168.1.2;
}
default-lease-time 600;
max-lease-time 7200;
authoritative;



修改/etc/network/interfaces
#nano /etc/network/interfaces
第7行iface eth0 inet dhcp,改为iface eth0 inet manual




文件最后加入以下内容
auto eth0:0
iface eth0:0 inet static
address 192.168.1.2
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.2



修改/etc/sysctl.conf
#nano /etc/sysctl.conf
去掉net.ipv4.ip_forward=1前面的#号



然后执行
#sysctl -p


修改/etc/rc.local
#nano /etc/rc.local
在exit 0前加入以下内容

ifconfig eth0:0 192.168.1.2 up
sleep 10
service isc-dhcp-server restart
iptables -t nat -A POSTROUTING -j MASQUERADE

至此,N1路由器设置完成。











评分

参与人数 1恩山币 +2 收起 理由
hcyme + 2 面对这种帖子,我内心复杂,真不知道说什么好……

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
发表于 2018-11-29 22:56 | 显示全部楼层
疯了疯了,N1成万能的了……
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-11-29 23:00 | 显示全部楼层
配个图吧,这排版眼疼
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-11-29 23:25 | 显示全部楼层
心理有数 发表于 2018-11-29 23:00
配个图吧,这排版眼疼

这个未完待续的。一边折腾一边写。我见很多教程都是基于4.18的,就装了个4.19的测试下咯
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-11-29 23:31 | 显示全部楼层
zwqcactus 发表于 2018-11-29 22:56
疯了疯了,N1成万能的了……

期待会有大神搞个程序通过手机蓝牙控制n1
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-11-29 23:42 | 显示全部楼层
4.19有bug 随机断网 无解 很看运气 有时候几天不断 有时候几小时就断了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-11-29 23:59 | 显示全部楼层
708963240 发表于 2018-11-29 23:42
4.19有bug 随机断网 无解 很看运气 有时候几天不断 有时候几小时就断了

yangxuan8282的帖子有详细说明如何解决断网问题。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-11-30 00:05 | 显示全部楼层
终于等到兄弟的神作了,厉害厉害,拜读了!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-11-30 01:41 | 显示全部楼层
tinylion 发表于 2018-11-30 00:05
终于等到兄弟的神作了,厉害厉害,拜读了!

目前测试,没有传说中的断流bug. 系统用ubuntu功耗会低些,cpu温度40-48C。用debian温度会高10度。N1除了usb口少,没有短板,这个可能是最具影响力的软路由方案了。才不到一百块钱。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-11-30 07:20 | 显示全部楼层
speedturtle 发表于 2018-11-30 01:41
目前测试,没有传说中的断流bug. 系统用ubuntu功耗会低些,cpu温度40-48C。用debian温度会高10度。N1除了 ...

老哥,这个的话,可以装什么插件了。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-11-30 07:22 | 显示全部楼层
chsylb 发表于 2018-11-30 07:20
老哥,这个的话,可以装什么插件了。。

你打开看看就知道了。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-11-30 08:03 | 显示全部楼层
给技术人儿大佬跪下了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-11-30 08:06 | 显示全部楼层
100不如去买个新3刷机。。。。当然喜欢折腾的就不说了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-11-30 08:27 | 显示全部楼层
我想给N1 装个windows.....
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-11-30 08:31 | 显示全部楼层
N1是usb2.0.有千兆网卡也没用
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-19 17:36

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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