openwrt网络共享zeroTier异地无法访问原因

文章目录[隐藏]

写在前面

设置共享这些就不写了,主要写一下这次遇到的问题

1,共享后,本地局域网IP:192.168.2.2 能正常打开共享目录

1

2,zerotier后,虚拟的IP:192.168.192.215 ,WEB能正常访问

3,IP:192.168.192.215 SMB不能访问共享目录

过程

首先以为是防火墙问题,一通设置后,把原来跑不满千兆原因反而找到了,也算因额外收获吧!

https://mailberry.com.cn/2021/01/%e8%ae%b0%e5%bd%95%e4%b8%80%e4%b8%8b%e7%8e%a9%e5%ae%a2%e4%ba%91%e5%ae%89%e8%a3%85openwrt%e5%8f%8a%e9%85%b8%e9%85%b8%e4%b9%b3plus%e8%bf%87%e7%a8%8b/

接着从共享找原因

先看对比以前能正常使用的模板

[global]
netbios name = |NAME|
display charset = |CHARSET|
interfaces = |INTERFACES|
server string = |DESCRIPTION|
unix charset = |CHARSET|
workgroup = |WORKGROUP|
bind interfaces only = no
deadtime = 30
enable core files = no
# invalid users = root
local master = no
map to guest = Bad User
max protocol = SMB2
min receivefile size = 16384
null passwords = yes
security = user
passdb backend = smbpasswd

smb passwd file = /etc/samba/smbpasswd

use sendfile = yes

现在固件代码

[global]
netbios name = |NAME|
display charset = |CHARSET|
interfaces = |INTERFACES|
server string = |DESCRIPTION|
unix charset = |CHARSET|
workgroup = |WORKGROUP|
bind interfaces only = yes
deadtime = 30
enable core files = no
#invalid users = root
local master = yes
map to guest = Bad User
max protocol = SMB2
min receivefile size = 16384
null passwords = yes

passdb backend = smbpasswd
security = user
smb passwd file = /etc/samba/smbpasswd
socket options = TCP_NODELAY IPTOS_LOWDELAY
use sendfile = yes

通过对比

以现能正常使用的模板与不能访问的新模板有2行代码不一样

bind interfaces only = no

local master = no

新模板还多了行代码

socket options = TCP_NODELAY IPTOS_LOWDELAY

解决办法

只要把bind interfaces only = yes 改成no就可以了

生成海报
点赞 1

1 条评论

  1. a

    模板是在哪里查看?

发表评论

您的电子邮件地址不会被公开,必填项已用*标注。

相关推荐