小米路由R3G 安装OpenWrt 全记录

刷机 开发版

刷机 OpenWrt

不支持SFTP

OpenWrt 默认不支持 SFTP,请使用WINSCP的SCP模式传输文件!
OpenWrt 默认不支持 SFTP,请使用WINSCP的SCP模式传输文件!
OpenWrt 默认不支持 SFTP,请使用WINSCP的SCP模式传输文件!

breed 这个 bootloader 可以不用安装
如果后续 更换为其他固件, 建议安装 breed
否则 在OpenWrt更换其他固件 还是有点麻烦.

备份系统

可选操作, 可以跳过

可以保存在U盘中,
也可以保存在/tmp目录下, 使用WINSCP的SCP模式传输出来

分区分布

1
cat /proc/mtd > /extdisks/sdb/backup/mtd_info

备份分区

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
mkdir -p /extdisks/sdb/backup

dd if=/dev/mtd0 of=/extdisks/sdb/backup/ALL.bin
dd if=/dev/mtd1 of=/extdisks/sdb/backup/Bootloader.bin
dd if=/dev/mtd2 of=/extdisks/sdb/backup/Config.bin
dd if=/dev/mtd3 of=/extdisks/sdb/backup/Bdata.bin
dd if=/dev/mtd4 of=/extdisks/sdb/backup/Factory.bin
dd if=/dev/mtd5 of=/extdisks/sdb/backup/crash.bin
dd if=/dev/mtd6 of=/extdisks/sdb/backup/crash_syslog.bin
dd if=/dev/mtd7 of=/extdisks/sdb/backup/reserved0.bin
dd if=/dev/mtd8 of=/extdisks/sdb/backup/kernel0.bin
dd if=/dev/mtd9 of=/extdisks/sdb/backup/kernel1.bin
dd if=/dev/mtd10 of=/extdisks/sdb/backup/rootfs0.bin
dd if=/dev/mtd11 of=/extdisks/sdb/backup/rootfs1.bin
dd if=/dev/mtd12 of=/extdisks/sdb/backup/overlay.bin
dd if=/dev/mtd13 of=/extdisks/sdb/backup/ubi_rootfs.bin


root@XiaoQiang:~# ll -h /extdisks/sdb/backup
-rwxrwxrwx 1 root root 127.5M Oct 30 12:59 ALL.bin
-rwxrwxrwx 1 root root 256.0K Oct 30 12:59 Bdata.bin
-rwxrwxrwx 1 root root 512.0K Oct 30 12:59 Bootloader.bin
-rwxrwxrwx 1 root root 256.0K Oct 30 12:59 Config.bin
-rwxrwxrwx 1 root root 256.0K Oct 30 12:59 Factory.bin
-rwxrwxrwx 1 root root 256.0K Oct 30 12:59 crash.bin
-rwxrwxrwx 1 root root 256.0K Oct 30 12:59 crash_syslog.bin
-rwxrwxrwx 1 root root 4.0M Oct 30 12:59 kernel0.bin
-rwxrwxrwx 1 root root 4.0M Oct 30 12:59 kernel1.bin
-rwxrwxrwx 1 root root 547 Oct 30 13:01 mtd_info
-rwxrwxrwx 1 root root 53.5M Oct 30 13:00 overlay.bin
-rwxrwxrwx 1 root root 256.0K Oct 30 12:59 reserved0.bin
-rwxrwxrwx 1 root root 32.0M Oct 30 12:59 rootfs0.bin
-rwxrwxrwx 1 root root 32.0M Oct 30 12:59 rootfs1.bin
-rwxrwxrwx 1 root root 18.6M Oct 30 13:00 ubi_rootfs.bin
root@XiaoQiang:~#

恢复

1
2
3
4
5
6
7
8
9
10
11
12
13
mtd write /extdisks/sdb/backup/Bootloader.bin Bootloader
mtd write /extdisks/sdb/backup/Config.bin Config
mtd write /extdisks/sdb/backup/Bdata.bin Bdata
mtd write /extdisks/sdb/backup/Factory.bin Factory
mtd write /extdisks/sdb/backup/crash.bin crash
mtd write /extdisks/sdb/backup/crash_syslog.bin crash_syslog
mtd write /extdisks/sdb/backup/reserved0.bin reserved0
mtd write /extdisks/sdb/backup/kernel0.bin kernel0
mtd write /extdisks/sdb/backup/kernel1.bin kernel1
mtd write /extdisks/sdb/backup/rootfs0.bin rootfs0
mtd write /extdisks/sdb/backup/rootfs1.bin rootfs1
mtd write /extdisks/sdb/backup/overlay.bin overlay
mtd write /extdisks/sdb/backup/ubi_rootfs.bin ubi_rootfs

传输

可以保存在 U盘中

也可以 使用 WinSCP的SCP模式传出, 不可以使用 SFTP !
或者使用 linux的scp命令.

刷固件:

1
2
3
4
5
mtd write openwrt-21.02.3-ramips-mt7621-xiaomi_mi-router-3g-squashfs-kernel1.bin kernel1
mtd write openwrt-21.02.3-ramips-mt7621-xiaomi_mi-router-3g-squashfs-rootfs0.bin rootfs0
nvram set flag_try_sys1_failed=1
nvram commit
reboot

重启后,网线连接
DHCP:192.168.1.1
web:root 无密码直接回车
默认WiFi 没有开启

安装常规工具

1
2
3
4
5
6
7
8
opkg update
opkg install bash #vim /etc/passwd
opkg install htop
opkg install curl
opkg install netcat
opkg install iperf3
opkg install vim
opkg install openssh-sftp-server

报文收发极限测试

LAN 1000M连接

R3G: iperf -s

windows :输出

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

C:\EXE\iperf-3.1.3-win64>iperf3 -c 192.168.0.1 #单线程
Connecting to host 192.168.0.1, port 5201
[ 4] local 192.168.0.182 port 8777 connected to 192.168.0.1 port 5201
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-1.00 sec 79.9 MBytes 670 Mbits/sec
[ 4] 1.00-2.00 sec 81.8 MBytes 685 Mbits/sec
[ 4] 2.00-3.00 sec 80.4 MBytes 674 Mbits/sec
[ 4] 3.00-4.00 sec 77.4 MBytes 649 Mbits/sec
[ 4] 4.00-5.00 sec 81.9 MBytes 687 Mbits/sec
[ 4] 5.00-6.00 sec 82.0 MBytes 688 Mbits/sec
[ 4] 6.00-7.00 sec 79.6 MBytes 667 Mbits/sec
[ 4] 7.00-8.00 sec 82.4 MBytes 691 Mbits/sec
[ 4] 8.00-9.00 sec 82.0 MBytes 689 Mbits/sec
[ 4] 9.00-10.00 sec 82.0 MBytes 687 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-10.00 sec 809 MBytes 679 Mbits/sec sender
[ 4] 0.00-10.00 sec 809 MBytes 679 Mbits/sec receiver

iperf Done.

C:\EXE\iperf-3.1.3-win64>iperf3 -c 192.168.0.1 -R #单线程
Connecting to host 192.168.0.1, port 5201
Reverse mode, remote host 192.168.0.1 is sending
[ 4] local 192.168.0.182 port 8779 connected to 192.168.0.1 port 5201
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-1.00 sec 74.4 MBytes 624 Mbits/sec
[ 4] 1.00-2.00 sec 74.8 MBytes 628 Mbits/sec
[ 4] 2.00-3.00 sec 85.0 MBytes 713 Mbits/sec
[ 4] 3.00-4.00 sec 90.2 MBytes 757 Mbits/sec
[ 4] 4.00-5.00 sec 90.4 MBytes 759 Mbits/sec
[ 4] 5.00-6.00 sec 88.1 MBytes 739 Mbits/sec
[ 4] 6.00-7.00 sec 90.4 MBytes 758 Mbits/sec
[ 4] 7.00-8.00 sec 90.1 MBytes 756 Mbits/sec
[ 4] 8.00-9.00 sec 89.4 MBytes 750 Mbits/sec
[ 4] 9.00-10.00 sec 86.8 MBytes 728 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 861 MBytes 722 Mbits/sec 0 sender
[ 4] 0.00-10.00 sec 861 MBytes 722 Mbits/sec receiver

iperf Done.

C:\EXE\iperf-3.1.3-win64>

WiFi 性能测试

Wifi 5G 连接

苹果手机安装 iPerf

R3G

运行: iperf3 -s

传输流: iphone 8p 到 R3G, iphone 8p使用单线程

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
root@OpenWrt:~# iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 192.168.0.202, port 49697
[ 5] local 192.168.0.1 port 5201 connected to 192.168.0.202 port 49698
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 35.4 MBytes 296 Mbits/sec
[ 5] 1.00-2.00 sec 44.5 MBytes 373 Mbits/sec
[ 5] 2.00-3.00 sec 40.2 MBytes 338 Mbits/sec
[ 5] 3.00-4.00 sec 34.8 MBytes 292 Mbits/sec
[ 5] 4.00-5.00 sec 43.7 MBytes 365 Mbits/sec
[ 5] 5.00-6.00 sec 43.9 MBytes 368 Mbits/sec
[ 5] 6.00-7.00 sec 45.8 MBytes 385 Mbits/sec
[ 5] 7.00-8.00 sec 47.1 MBytes 395 Mbits/sec
[ 5] 8.00-9.00 sec 46.8 MBytes 393 Mbits/sec
[ 5] 9.00-10.00 sec 46.1 MBytes 386 Mbits/sec
[ 5] 10.00-11.00 sec 46.9 MBytes 393 Mbits/sec
[ 5] 11.00-12.00 sec 46.9 MBytes 394 Mbits/sec
[ 5] 12.00-13.00 sec 47.1 MBytes 396 Mbits/sec
[ 5] 13.00-14.00 sec 46.8 MBytes 393 Mbits/sec
[ 5] 14.00-15.00 sec 44.5 MBytes 373 Mbits/sec
[ 5] 15.00-16.00 sec 47.2 MBytes 395 Mbits/sec
[ 5] 16.00-17.00 sec 46.8 MBytes 393 Mbits/sec
[ 5] 17.00-18.00 sec 46.8 MBytes 393 Mbits/sec
[ 5] 18.00-19.00 sec 47.1 MBytes 395 Mbits/sec
[ 5] 19.00-20.00 sec 45.2 MBytes 380 Mbits/sec
[ 5] 20.00-21.00 sec 47.0 MBytes 395 Mbits/sec
[ 5] 21.00-22.00 sec 46.9 MBytes 394 Mbits/sec
[ 5] 22.00-23.00 sec 47.0 MBytes 394 Mbits/sec
[ 5] 23.00-24.00 sec 47.0 MBytes 394 Mbits/sec
[ 5] 24.00-25.00 sec 46.7 MBytes 391 Mbits/sec
[ 5] 25.00-26.00 sec 46.9 MBytes 394 Mbits/sec
[ 5] 26.00-27.00 sec 47.0 MBytes 394 Mbits/sec
[ 5] 27.00-28.00 sec 46.9 MBytes 394 Mbits/sec
[ 5] 28.00-29.00 sec 46.9 MBytes 393 Mbits/sec
[ 5] 29.00-30.00 sec 45.8 MBytes 385 Mbits/sec
[ 5] 30.00-30.01 sec 533 KBytes 333 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-30.01 sec 1.33 GBytes 381 Mbits/sec receiver
-----------------------------------------------------------
Server listening on 5201 (test #2)
-----------------------------------------------------------

传输流: r3G 到 苹果8p, iphone 8p使用单线程

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Accepted connection from 192.168.0.202, port 49699
[ 5] local 192.168.0.1 port 5201 connected to 192.168.0.202 port 49700
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.04 sec 35.1 MBytes 284 Mbits/sec 0 805 KBytes
[ 5] 1.04-2.04 sec 39.5 MBytes 329 Mbits/sec 2 530 KBytes
[ 5] 2.04-3.00 sec 23.6 MBytes 207 Mbits/sec 1 1.41 KBytes
[ 5] 3.00-4.06 sec 16.2 MBytes 129 Mbits/sec 17 448 KBytes
[ 5] 4.06-5.04 sec 38.8 MBytes 329 Mbits/sec 0 508 KBytes
[ 5] 5.04-6.05 sec 39.5 MBytes 330 Mbits/sec 0 543 KBytes
[ 5] 6.05-7.05 sec 41.2 MBytes 346 Mbits/sec 0 577 KBytes
[ 5] 7.05-8.03 sec 41.2 MBytes 351 Mbits/sec 0 591 KBytes
[ 5] 8.03-9.04 sec 42.5 MBytes 356 Mbits/sec 0 598 KBytes
[ 5] 9.04-10.06 sec 40.0 MBytes 328 Mbits/sec 0 600 KBytes
[ 5] 10.06-11.05 sec 37.6 MBytes 319 Mbits/sec 0 600 KBytes
[ 5] 11.05-12.05 sec 42.5 MBytes 354 Mbits/sec 0 600 KBytes
[ 5] 12.05-13.04 sec 41.2 MBytes 352 Mbits/sec 0 608 KBytes
[ 5] 13.04-14.00 sec 40.4 MBytes 351 Mbits/sec 0 624 KBytes
[ 5] 14.00-15.04 sec 37.1 MBytes 298 Mbits/sec 0 650 KBytes
[ 5] 15.04-16.00 sec 33.3 MBytes 292 Mbits/sec 4 262 KBytes
[ 5] 16.00-17.00 sec 30.6 MBytes 257 Mbits/sec 0 337 KBytes
[ 5] 17.00-18.04 sec 36.6 MBytes 297 Mbits/sec 0 413 KBytes
[ 5] 18.04-19.01 sec 42.5 MBytes 365 Mbits/sec 0 477 KBytes
[ 5] 19.01-20.00 sec 33.3 MBytes 283 Mbits/sec 2 387 KBytes
[ 5] 20.00-21.01 sec 30.8 MBytes 257 Mbits/sec 0 444 KBytes
[ 5] 21.01-22.02 sec 29.5 MBytes 245 Mbits/sec 0 492 KBytes
[ 5] 22.02-23.03 sec 39.2 MBytes 325 Mbits/sec 0 544 KBytes
[ 5] 23.03-24.01 sec 35.2 MBytes 302 Mbits/sec 0 584 KBytes
[ 5] 24.01-25.00 sec 1.49 MBytes 12.6 Mbits/sec 1 1.41 KBytes
[ 5] 25.00-26.05 sec 33.8 MBytes 270 Mbits/sec 18 471 KBytes
[ 5] 26.05-27.03 sec 41.5 MBytes 355 Mbits/sec 0 530 KBytes
[ 5] 27.03-28.01 sec 38.2 MBytes 329 Mbits/sec 0 577 KBytes
[ 5] 28.01-29.04 sec 38.4 MBytes 313 Mbits/sec 0 626 KBytes
[ 5] 29.04-30.04 sec 39.6 MBytes 329 Mbits/sec 0 663 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-30.05 sec 1.04 GBytes 296 Mbits/sec 45 sender
-----------------------------------------------------------
Server listening on 5201 (test #3)
-----------------------------------------------------------

自动挂载FAT32/exFAT/NTFS硬盘

OpenWrt挂载 NTFS 真的非常慢

这个 挂载 FT32–CPU 跑满 速度为 103MB/S

这个 挂载NTFS–CPU 跑满 速度为 23MB/S

内核驱动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
opkg update
opkg install kmod-usb-core
opkg install kmod-usb-storage
opkg install kmod-usb2
opkg install kmod-usb3
opkg install usbutils
opkg install blockd #用于自动挂载
opkg install lsblk #用于查看块设备
opkg install block-mount
opkg install mount-utils
opkg install libblkid
opkg install kmod-fs-vfat #FAT32

# 可选内核驱动
opkg install kmod-fs-exfat
opkg install kmod-fs-ext4
opkg install kmod-fs-xfs

# NTFS驱动(非常慢,不推荐!)
opkg install ntfs-3g #读取速度约35M
ln -s /usr/bin/ntfs-3g /sbin/mount.ntfs # 否则 NTFS 不会 自动挂载(ntfs-3g)

#一种更快的NTFS文件系统读写驱动
opkg install kmod-fs-ufsd #我没有找到此驱动-据说在潘多拉里面可以找到

重启

重启后,在web【System】【Mount Points】可以看到, U盘已经是默认挂载项。
启用 enable 挂载点

block探测

1
2
3
4
5
6
root@OpenWrt:~# block info
/dev/mtdblock9: UUID="1650113974" VERSION="1" TYPE="ubi"
/dev/ubiblock0_0: UUID="f2a09968-76968b4f-7b93b9fa-98085058" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="8c206727-abbd-4d7a-b61b-16789f039ef4" VERSION="w5r0" MOUNT="/overlay" TYPE="ubifs"
/dev/sda1: UUID="C0B61930B6192904" LABEL="ST2000LM" TYPE="ntfs"
root@OpenWrt:~#

block 默认配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
root@OpenWrt:~# block detect
config 'global'
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'

config 'mount'
option target '/mnt/sda1'
option uuid 'C0B61930B6192904'
option enabled '0'

root@OpenWrt:~#

系统挂载设置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
root@OpenWrt:~# cat /etc/config/fstab
config global
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'

config mount
option target '/mnt/sda1'
option uuid 'C0B61930B6192904'
option enabled '1'
option fstype 'ntfs-3g'

root@OpenWrt:~#

挂载测试

1
2
3
4
root@OpenWrt:~# block umount && block mount

#NTFS 挂载不上, 就是在这里发现的。
ln -s /usr/bin/ntfs-3g /sbin/mount.ntfs # 否则 NTFS 不会 自动挂载

重启, 检测 NTFS 是否能够自动挂载

硬盘自动休眠

1
2
3
4
5
6
7
8
9
10
11
12
13
opkg install hdparm
opkg install hd-idle #luci版只能配置一块盘


硬盘自动休眠-配置 1分钟

root@OpenWrt:~# cat /etc/config/hd-idle
config 'hd-idle'
option 'disk' 'sda'
option 'enabled' '1'
option 'idle_time_unit' 'minutes'
option 'idle_time_interval' '1'
root@OpenWrt:~#

安全的移除USB设备

1
2
3
hdparm -S 1 /dev/sda 设置硬盘5秒内停转。
umount /dev/sda 将文件系统 与 系统分离, 但是分区信息依然存在。设备依然存在
eject -s /dev/sda 将设备脱离总线,但是芯片驱动依然在USB设备树上。

移除之前

查看挂载状态

1
2
3
4
5
6
7
8
9
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 3.5M 3.5M 0 100% /rom
tmpfs 123.1M 3.8M 119.3M 3% /tmp
/dev/ubi0_1 97.5M 24.0M 68.8M 26% /overlay
overlayfs:/overlay 97.5M 24.0M 68.8M 26% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda1 1.8T 531.2G 1.3T 29% /mnt/sda1
root@OpenWrt:~#

查看USB设备树

1
2
3
4
5
root@OpenWrt:/sys/devices/platform# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/1p, 5000M
|__ Port 1: Dev 3, If 0, Class=, Driver=usb-storage, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/2p, 480M
root@OpenWrt:/sys/devices/platform#

查看制造商

1
2
3
4
5
root@OpenWrt:~# find /sys/devices/platform |  grep -i manufacture |xargs grep -n ''
/sys/devices/platform/1e1c0000.xhci/usb1/manufacturer:1:Linux 5.4.188 xhci-hcd
/sys/devices/platform/1e1c0000.xhci/usb2/manufacturer:1:Linux 5.4.188 xhci-hcd
/sys/devices/platform/1e1c0000.xhci/usb2/2-1/manufacturer:1:JMicron
root@OpenWrt:~#

移除

1
root@OpenWrt:~# echo 1 > /sys/devices/platform/1e1c0000.xhci/usb2/2-1/remove

查看USB设备树

1
2
3
4
root@OpenWrt:~# lsusb  -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/1p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/2p, 480M
root@OpenWrt:~#

查看制造商

1
2
3
4
root@OpenWrt:~# find /sys/devices/platform |  grep -i manufacture |xargs grep -n ''
/sys/devices/platform/1e1c0000.xhci/usb1/manufacturer:1:Linux 5.4.188 xhci-hcd
/sys/devices/platform/1e1c0000.xhci/usb2/manufacturer:1:Linux 5.4.188 xhci-hcd
root@OpenWrt:~#

查看挂载状态

1
2
3
4
5
6
7
8
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 3.5M 3.5M 0 100% /rom
tmpfs 123.1M 3.8M 119.3M 3% /tmp
/dev/ubi0_1 97.5M 24.0M 68.8M 26% /overlay
overlayfs:/overlay 97.5M 24.0M 68.8M 26% /
tmpfs 512.0K 0 512.0K 0% /dev
root@OpenWrt:~#

已经安全的移除了 USB 设备

安装Samba

现在最新的版本是 Samba4

1
2
opkg update
opkg install samba4-server

创建Samba用户

不要使用 smbpasswd 命令创建用户, 这个命令不能查询

1
smbpasswd -a root

推荐: pdbedit

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
root@OpenWrt:/etc/samba# pdbedit -a  root
new password:
retype new password:
Unix username: root
NT username:
Account Flags: [U ]
User SID: S-1-5-21
Primary Group SID: S-1-5-21
Full Name: root
Home Directory: \\OPENWRT\root
HomeDir Drive:
Logon Script:
Profile Path: \\OPENWRT\root\profile
Domain: OPENWRT
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: never
Kickoff time: never
Password last set: Tue, 14 Mar 2023 20:09:48 CST
Password can change: Tue, 14 Mar 2023 20:09:48 CST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
root@OpenWrt:/etc/samba#

删除默认的配置文件

1
rm -rf  /etc/samba/smb.conf

配置 Samba

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[global]
unix charset = UTF-8
workgroup = WORKGROUP

security = user
smb encrypt = default
passdb backend = smbpasswd

socket options = IPTOS_LOWDELAY TCP_NODELAY

aio read size = 0
aio write size = 0
use sendfile = yes

# 针对 MACOS !
veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/
delete veto files = yes

#注释下面的guest, 即可启用 guest
#map to guest = Bad User
#null passwords = yes


[Hello]
path = /mnt/
writeable = yes
create mask = 0664
directory mask = 0775

#guest ok = yes
#guest only = yes
#guest account = root

重启服务

1
service samba4 restart

测验

windows CMD

1
2
3
4
5
cd /d %USERPROFILE%
net use * /delete /yes

net use X: \\192.168.88.200\Hello /user:root 密码
dir X:

无响应/忘记密码 重置

情况1:

当错误的配置了 OpenWrt 导致无法启动时, 如过跨大版本升级, 密码
当OpenWrt配置了错误的 IP 无法登录时
  1. 按住 reset 按键 直到 红灯闪烁, 等待 重启.
  2. 进入 192.168.1.1 web页即可.

情况2:

如果设置了错误的配置, 导致OS没有完整启动,用上面的办法没有时.

  1. 断电->上电

  2. 用ping工具一直ping 192.168.1.1

  3. 屏幕上会有短暂的瞬间 能够ping通

  4. 用牙签 顶一下 R3G 的reset 按钮,立即松开

  5. 用SSH 工具连接进去 ssh root@192.168.1.1

  6. 进入故障模式, 输入 恢复为出厂设置



WiFi 漫游

1
2
3
4
5
6
7
8
9
10
11
12
13
14
启用 WIFI 漫游 802.11r 

opkg update
opkg list-installed | grep wpad
opkg remove wpad-basic-mbedtls
opkg install wpad-mesh-wolfssl
reboot

信道:auto
802.11r Fast Transition 打钩
NSID:MAC地址去冒号的字符
Mobility Domain: 1221(一致就行)
Reassociation Deadline:20000
FT protocol: FT Over Air

Nginx 转SSL

ShadowSocks 科研上网 透明代理 国内外分流

按键感应

恢复原版系统