实施目的:买了一台深圳套路云,用于中转连回家里内网,顺便用$$R 的 http_simple 免流。
套路云 IP:39.108.x.x ;主机名称:ALI-CN3
家中内网 IP 段:192.168.100.0/22
OpenV 屁恩 IP 段:192.168.104.128/25
在家中服务器搭建 OpenV 屁恩服务端,通过 FRP 把 OV 监听端口映射到套路云小鸡,套路云小鸡搭建 OV 客户端连接映射过来的端口,连接后一切正常,能创建一个 tun0 的虚拟网卡。
[root@ALI-CN3 ~]# ifconfig tun0
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 192.168.104.134 netmask 255.255.255.255 destination 192.168.104.133
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 100 bytes 11288 (11.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 108 bytes 6955 (6.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
注:OV 服务端配置文件已经配置“ push "route 192.168.100.0 255.255.252.0"”。
尝试跟踪路由到家中 192.168.100.0/22 网段的小鸡,一切正常:
[root@ALI-CN3 ~]# traceroute 192.168.100.2
traceroute to 192.168.100.2 (192.168.100.2), 30 hops max, 60 byte packets
1 192.168.104.129 (192.168.104.129) 7.390 ms 7.386 ms 7.381 ms
2 192.168.100.2 (192.168.100.2) 8.203 ms 8.205 ms 8.201 ms
尝试 ping,也正常:
[root@ALI-CN3 ~]# ping -c 10 192.168.100.2
PING 192.168.100.2 (192.168.100.2) 56(84) bytes of data.
64 bytes from 192.168.100.2: icmp_seq=1 ttl=63 time=6.50 ms
64 bytes from 192.168.100.2: icmp_seq=2 ttl=63 time=7.01 ms
64 bytes from 192.168.100.2: icmp_seq=3 ttl=63 time=6.48 ms
64 bytes from 192.168.100.2: icmp_seq=4 ttl=63 time=6.79 ms
64 bytes from 192.168.100.2: icmp_seq=5 ttl=63 time=6.93 ms
64 bytes from 192.168.100.2: icmp_seq=6 ttl=63 time=6.90 ms
64 bytes from 192.168.100.2: icmp_seq=7 ttl=63 time=6.93 ms
64 bytes from 192.168.100.2: icmp_seq=8 ttl=63 time=6.83 ms
64 bytes from 192.168.100.2: icmp_seq=9 ttl=63 time=6.92 ms
64 bytes from 192.168.100.2: icmp_seq=10 ttl=63 time=7.21 ms
--- 192.168.100.2 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9015ms
rtt min/avg/max/mdev = 6.483/6.854/7.216/0.237 ms
路由表,看起来也正常:
[root@ALI-CN3 ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.18.111.253 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
172.18.96.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
192.168.100.0 192.168.104.133 255.255.252.0 UG 0 0 0 tun0
192.168.104.128 192.168.104.133 255.255.255.128 UG 0 0 0 tun0
192.168.104.133 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
问题来了,我在外面通过$$R 全局代理(没有绕过局域网)连接套路云 39.108.x.x 这个 IP 后,访问互联网正常,访问
ipip.net 也能显示 39.108.x.x,证明流量有走代理。但无法访问家中 192.168.100.0/22 网段的所有主机。想了两天,已经抓破头皮了。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.