找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 441|回复: 20

如何访问zerotier节点下的局域网电脑?

[复制链接]
发表于 2023-9-19 00:55 | 显示全部楼层 |阅读模式
本帖最后由 quester0 于 2023-9-19 02:06 编辑

如下简图,已在zerotier网页设置10.10.0.0/24网关为192.168.192.2,现在192.168.192.11(实际win7)双方互 ping 192.168.192.2/10.10.0.100(windows server 2008 r2)正常,怎么设置可以ping通10.10.0.200(win7)?
55bd67f6e8deaefc5270ae1a57d35dead12fc123.png
我的恩山、我的无线 The best wifi forum is right here.
发表于 2023-9-20 07:47 | 显示全部楼层
quester0 发表于 2023-9-20 07:43
192.11是单网卡,192.2双网卡,不过只插一根网线。

要么就是你的Windows系统不能准确使用路由表,与其这样折腾,还不如在Windows里面虚拟一个openwrt来解决。

点评

是的,windows这方面比较难设置,计划在192.2里面用vmware虚拟x86 openwrt,推荐用什么虚拟机?192.11局域网有个黑群晖,使用zerotier后192.2局域网内都可以访问192.11局域网的任意主机了。  详情 回复 发表于 2023-9-20 07:57
我的恩山、我的无线 The best wifi forum is right here.
发表于 2023-9-19 23:47 | 显示全部楼层
quester0 发表于 2023-9-19 23:24
我按这个帖子设置了,还是不能访问10.10.0.200,

windows主机是单网卡还是双网卡?

点评

192.11是单网卡,192.2双网卡,不过只插一根网线。  详情 回复 发表于 2023-9-20 07:43
我的恩山、我的无线 The best wifi forum is right here.
发表于 2023-9-19 02:03 | 显示全部楼层
每台设备都安装zerotier客户端即可

点评

就是这样需要安装的太多,有时超过免费版zerotier允许组网的数量了。  详情 回复 发表于 2023-9-19 02:08
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2023-9-19 02:08 | 显示全部楼层
xdm2211 发表于 2023-9-19 02:03
每台设备都安装zerotier客户端即可

就是这样需要安装的太多,有时超过免费版zerotier允许组网的数量了。

点评

换tailscale  详情 回复 发表于 2023-9-19 02:16
我的恩山、我的无线 The best wifi forum is right here.
发表于 2023-9-19 02:16 | 显示全部楼层
quester0 发表于 2023-9-19 02:08
就是这样需要安装的太多,有时超过免费版zerotier允许组网的数量了。

换tailscale
我的恩山、我的无线 The best wifi forum is right here.
发表于 2023-9-19 03:48 | 显示全部楼层

点评

这个链接的案例是代理节点是linux,linux好像ip转发很方便,这个代理节点是linux已经成功了。 Enable IP forwarding This can vary depending on linux distribution. Typically: Edit /etc/sysctl.conf to uncomme  详情 回复 发表于 2023-9-19 07:44
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2023-9-19 07:44 | 显示全部楼层
99010 发表于 2023-9-19 03:48
https://zerotier.atlassian.net/wiki/spaces/SD/pages/224395274/Route+between+ZeroTier+and+Physical+Ne ...

这个链接的案例是代理节点是linux,linux好像ip转发很方便,这个代理节点是linux已经成功了。
Enable IP forwarding
This can vary depending on linux distribution. Typically:

Edit /etc/sysctl.conf to uncomment net.ipv4.ip_forward. This enables forwarding at boot.

To enable it now



sudo sysctl -w net.ipv4.ip_forward=1
Configure iptables
Assign some shell variables (personalize these)



PHY_IFACE=eth0; ZT_IFACE=zt7nnig26
Add rules to iptables



sudo iptables -t nat -A POSTROUTING -o $PHY_IFACE -j MASQUERADE
sudo iptables -A FORWARD -i $PHY_IFACE -o $ZT_IFACE -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i $ZT_IFACE -o $PHY_IFACE -j ACCEPT
Save iptables rules for next boot



sudo apt install iptables-persistent
sudo bash -c iptables-save > /etc/iptables/rules.v4


要是这个代理节点是windows server如这个链接,我按这个教程设置了还是没有成功。https://discuss.zerotier.com/t/windows-ethernet-bridging/473/33

点评

和Linux一样,Windows要设置转发和路由表  详情 回复 发表于 2023-9-19 14:51
我的恩山、我的无线 The best wifi forum is right here.
发表于 2023-9-19 10:51 | 显示全部楼层
配置路由表啊,远端PC那边没有路由器嘛
屏幕截图 2023-09-19 104956.png

点评

请问远端pc你指的是图中10.10.0.200吗? 现在192.168.192.11电脑上已添加10.10.0.0/24网段网关为192.168.192.2。  详情 回复 发表于 2023-9-19 11:02
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2023-9-19 11:02 | 显示全部楼层
小小葫芦娃 发表于 2023-9-19 10:51
配置路由表啊,远端PC那边没有路由器嘛

请问远端pc你指的是图中10.10.0.200吗?
现在192.168.192.11电脑上已添加10.10.0.0/24网段网关为192.168.192.2。

点评

10.10.0.100那边的zerotier也要设置允许nat啊  详情 回复 发表于 2023-9-19 11:05
我的恩山、我的无线 The best wifi forum is right here.
发表于 2023-9-19 11:05 | 显示全部楼层
quester0 发表于 2023-9-19 11:02
请问远端pc你指的是图中10.10.0.200吗?
现在192.168.192.11电脑上已添加10.10.0.0/24网段网关为192.168.1 ...

10.10.0.100那边的zerotier也要设置允许nat啊

点评

现在10.10.0.100即192.168.192.2主机windows server 2008 r2 访问192.168.192.11也是正常的。  详情 回复 发表于 2023-9-19 11:36
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2023-9-19 11:36 | 显示全部楼层
小小葫芦娃 发表于 2023-9-19 11:05
10.10.0.100那边的zerotier也要设置允许nat啊

现在10.10.0.100即192.168.192.2主机windows server 2008 r2 访问192.168.192.11也是正常的。
我的恩山、我的无线 The best wifi forum is right here.
发表于 2023-9-19 11:44 | 显示全部楼层
这里设置试试,类似于我设置的23网段可以通过22.250映射出去。前面填10.10.0.200/32,后面填192.168.192.2
111.png

点评

我设置的是10.10.0.0/24,via 192.168.192.2 192.2(10.10.0.100)和192.11可以互通, 就是和192.2同局域网的10.10.0.0/24其他主机不能互通。  详情 回复 发表于 2023-9-19 11:59
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2023-9-19 11:59 | 显示全部楼层
每一刻思念 发表于 2023-9-19 11:44
这里设置试试,类似于我设置的23网段可以通过22.250映射出去。前面填10.10.0.200/32,后面填192.168.192.2 ...

我设置的是10.10.0.0/24,via 192.168.192.2
192.2(10.10.0.100)和192.11可以互通,
就是192.11不能ping同192.2同局域网的10.10.0.0/24其他主机。
我的恩山、我的无线 The best wifi forum is right here.
发表于 2023-9-19 14:51 | 显示全部楼层
quester0 发表于 2023-9-19 07:44
这个链接的案例是代理节点是linux,linux好像ip转发很方便,这个代理节点是linux已经成功了。
Enable IP  ...

和Linux一样,Windows要设置转发和路由表

点评

已经将 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\IPEnableRoute设为1,已经开启Routing and Remote Access 服务并设置为自动。 192.11路由zerotier自动添加了,10.10.0.0/24 192.168  详情 回复 发表于 2023-9-19 16:06
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2023-9-19 16:06 | 显示全部楼层
99010 发表于 2023-9-19 14:51
和Linux一样,Windows要设置转发和路由表

已经将 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\IPEnableRoute设为1,已经开启Routing and Remote Access 服务并设置为自动。
192.11路由zerotier自动添加了,10.10.0.0/24 192.168.192.2,192.11还是不能ping通10.10.0.200。请问还应该再怎么设置?

点评

https://blog.csdn.net/weixin_44647835/article/details/109616688  详情 回复 发表于 2023-9-19 16:15
我的恩山、我的无线 The best wifi forum is right here.
发表于 2023-9-19 16:15 | 显示全部楼层
quester0 发表于 2023-9-19 16:06
已经将 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\IPEnableRoute设为1, ...

https://blog.csdn.net/weixin_44647835/article/details/109616688

点评

我按这个帖子设置了,还是不能访问10.10.0.200,  详情 回复 发表于 2023-9-19 23:24
我的恩山、我的无线 The best wifi forum is right here.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

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

GMT+8, 2023-9-28 11:21

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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