V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  Eaglemask  ›  全部回复第 5 页 / 共 6 页
回复总数  113
1  2  3  4  5  6  
329 天前
回复了 yawhale 创建的主题 随想 昨日回京走最右侧车道车速 160 迈
我这种开 110 公里 /H 最高的怂逼一般都是看着飞驰而去的楼主, 心里说一句傻鸟, 赶着去投胎吗? 早 3 个小时晚三小时到有区别吗? 难道有几十亿合同等着阁下亲临签字吗?
@dongzhuo777 目前是 istoreos 中跑的 zerotier 插件, 一样无法成功访问内网端其它非 istoreos 资源. zerotier 设置了内网机器转发了, 一样不行.

至于 iptable,已经设置过了不行.
@dongzhuo777 有朋友要用, 只能自建根节点.
@xpn282 其实我打算是在内网跑 K8S, 然后把现在在一些 IDC 上跑的服务迁移过来, 然后 IDC 上 VPS 只跑类似 nginxwebui 的代理流量到内网 K8S 上, 从而节约开支, 关键的是数据都在自己手里.

同时内网打算跑类似 iredmail 之类的服务, 然后 IDC 上 VPS 做中继出去, 同样是出于数据在自己手里的考虑.
330 天前
回复了 Eaglemask 创建的主题 程序员 自建 tailscale 和 zerotier 优劣对比请教.
@hperfect 谢谢, 请问 headscale 有 PC/linux/IOS 客户端吗?
@xpn282 异地组网和外网访问内网设备需求都需要.
@xpn282 我 zerotier 没搞定内网资源访问, 准备换 tailscale 了.
@wtsamuel 透明代理你用的是哪个? 推荐下?
@wtsamuel 推荐下你用的那种 openwrt? 装这个也好, 正好局域网需要个透明代理出去.
@wtsamuel 我的路由器是运营商的, 防火墙改为最低了, 进不去 ssh, 否则可以进去关闭防火墙或者安装那个 fake ip.

实在不行, 我打算在 PVE 中装一个 istoreos/openwrt 之类的来进行拨号并启用 dhcp, 这样也可以启用 fake ip
@oneisall8955

1. 在 ztncui 后台的网络 ABC 添加路由
192.168.2.0/24 via 10.199.188.23 ,这时候每个 zt client 都会得到一条路由表,Linux 通过 route -n 查看,window 通过 route print 查看
已增加并可以看到

2. 在 pve ( 192.168.2.99 即 10.199.188.23 )开启转发及 iptables 包转换
已经启用

2.1 `cat /proc/sys/net/ipv4/ip_forward`看下是否转发,0 的时候,直接 `echo 1 > /proc/sys/net/ipv4/ip_forward`
已启用

2.2 ifconfig 查看 zt 的网卡名称,也就是 zt 开头,IP 为 10.199.188.23 的网卡,如:ztxxxxxxxx
没问题.

2.3 iptables 添加允许及包转换,需要将 ztxxxxxxx 替换成你实际的 ifconfig 的网卡名称

iptables -I FORWARD -i ztxxxxxxxx -j ACCEPT

iptables -| FORWARD -o ztxxxxxxxx -j ACCEPT

iptables -t nat -I POSTROUTING -o ztxxxxxxxx -j MASQUERADE

都已经按照教程增加.
@azure2023us928 我倒是打算测试下自建 tailscale, 不知道这个是否有 ios 端?
@azure2023us928 8#

root@datacenter:~# iptable -list
-bash: iptable: command not found
root@datacenter:~# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 10.199.188.0/24 anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION-STAGE-1 all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain DOCKER (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 172.17.0.3 tcp dpt:9000

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target prot opt source destination
DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
RETURN all -- anywhere anywhere

Chain DOCKER-ISOLATION-STAGE-2 (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere

Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
root@datacenter:~#
@azure2023us928 #8

都试过啦, 都已经加上了.

9# 我不是要出墙, 宽带没有公网 ip 了, 不过可以打 10010 改为桥接.

至于 wireguard 的话懒得折腾了. zerotier 折腾了一周终于搞定.
@Evovil 感谢, 我慢慢参考下文档.
@azure2023us928 PVE 机器可以访问.2 段的, 因为它本身就是 192.168.2.99

root@datacenter:~# ping 10.199.188.153
PING 10.199.188.153 (10.199.188.153) 56(84) bytes of data.
64 bytes from 10.199.188.153: icmp_seq=1 ttl=128 time=2.32 ms
64 bytes from 10.199.188.153: icmp_seq=2 ttl=128 time=18.4 ms
64 bytes from 10.199.188.153: icmp_seq=3 ttl=128 time=3.05 ms
64 bytes from 10.199.188.153: icmp_seq=4 ttl=128 time=2.68 ms
^C
--- 10.199.188.153 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 2.318/6.601/18.367/6.797 ms
root@datacenter:~# ping 192.168.2.118
PING 192.168.2.118 (192.168.2.118) 56(84) bytes of data.
64 bytes from 192.168.2.118: icmp_seq=1 ttl=64 time=0.042 ms
64 bytes from 192.168.2.118: icmp_seq=2 ttl=64 time=0.048 ms
64 bytes from 192.168.2.118: icmp_seq=3 ttl=64 time=0.034 ms
^C
--- 192.168.2.118 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2048ms
rtt min/avg/max/mdev = 0.034/0.041/0.048/0.005 ms
@jllove 两边机器防火墙都关闭了

@azure2023us928
x25 (CCITT X.25)
root@datacenter:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 vmbr0
10.199.188.0 0.0.0.0 255.255.255.0 U 0 0 0 ztqrocq6fm
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 vmbr0
root@datacenter:~#
@angelmake 另外苹果手机的 app 加入到网路, 一直在 Pending 状态, 就算是翻墙了也不行, 不知道哪里有可以自定义 planet 的 IOS 段 APP.
@angelmake 我基本把所有的找到的都测试了, 都不行, 我怀疑是国外公网机器被墙了关键端口或者流量了.

国内的机器现在 docker 被墙了, 晚点我搭建个机器在国内跑下 planet 看看.
各位刚注册不能发帖, 所以这里粘贴下我的配置, 请帮忙看看为什么无法访问其它节点上资源, 谢谢.

1 台公网 IP 机器(在 vultr 开启了转发并关闭了防火墙)跑了自建 controller 并正常运行, ip 池手动分配设置了 192.168.1.0/24(内网段 1). 网络名称:ABC.

1 台安装在内网的 PVE 机器(192.168.2.99-内网段 2,) 通过 zerotier 加入到上述网络 ABC(设置激活了 active bridge), 且在 planet 上状态在线并拿到了 192.168.1.99

手机安装了 zerotier(设置激活了 active bridge)加入到上述网络 ABC, 且在 planet 上状态看到在线并拿到了 192.168.1.222.



目前需求, 需要手机访问 PVE 机器实现远管理, 以及需要访问 PVE 下几台虚拟机上资源如 gitea/nextcloud 等(此几台虚拟机 Ip 都是固定内网段 2,如 192.168.2.100, 192.168.2.111)

请问这种情况如何设置路由满足上述要求?
1  2  3  4  5  6  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5141 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 18ms · UTC 03:40 · PVG 11:40 · LAX 20:40 · JFK 23:40
Developed with CodeLauncher
♥ Do have faith in what you're doing.