PinkD / corplink-rs

使用 rust 实现的飞连客户端
GNU General Public License v2.0
194 stars 26 forks source link

我启动后 对端地址是0.0.0.0。 这个是什么原因呢 #9

Closed thurdaypeng closed 1 year ago

thurdaypeng commented 1 year ago

utun7: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1400 inet 10.180.206.67 --> 0.0.0.0 netmask 0xff000000

路由对比了一下 与飞连客户端生成的路由也不一致。 corplink-rs生成的

路由信息1:default、0.0.0.0、192.168.0.188、en0 路由信息2:10.30.0.0、255.255.0.0、10.180.207.11、utun7

飞连客户端生成的 路由信息1:default、0.0.0.0、192.168.0.188、en0 路由信息2:default、0.0.0.0、link#25、utun7 路由信息3:10.30.0.0、255.255.0.0、utun7、utun7

PinkD commented 1 year ago

inet 10.180.206.67 --> 0.0.0.0 netmask 0xff000000

飞连客户端这个对端是多少呢?我印象中 wg 是不用看这个 utun 设备的 peer 的,发给接口的数据包会自动发给对方

default、0.0.0.0、link#25、utun7

这个是默认路由走飞连,你飞连开的全局代理模式吗?我这边只会把 api 里返回的必需的 ip 段走飞连,需要路由其它网段就要自己手动加,没有全局的选项

thurdaypeng commented 1 year ago

@PinkD 飞连连上的话 样子是这样的 inet 10.180.206.67 --> 10.180.206.67 netmask 0xff000000

我飞连没开全局代理,也是极速代理。

thurdaypeng commented 1 year ago

看日志已经链接上了,但是网络不通。 start wg-corplink for utun7 launch wg-corplink utun7 with env: {} socket file /var/run/wireguard/utun7.sock not ready, sleep 1s try to connect unix sock: /var/run/wireguard/utun7.sock send config to uapi keep alive keep alive

PinkD commented 1 year ago
utun114: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1400
    inet 10.3.0.208 --> 0.0.0.0 netmask 0xff000000

10.0.0.0/8 via 10.3.0.208 dev utun114

ping 10.16.13.19
PING 10.16.13.19 (10.16.13.19): 56 data bytes
64 bytes from 10.16.13.19: icmp_seq=0 ttl=59 time=86.691 ms
64 bytes from 10.16.13.19: icmp_seq=1 ttl=59 time=73.520 ms
64 bytes from 10.16.13.19: icmp_seq=2 ttl=59 time=93.980 ms

mtr 试了下也确实是走的 utun114 这个接口的 ip 说明接口里的 peer 其实是没关系的,我怀疑是没有路由导致的,你把目标网段手动路由到这个 utun 上试试?比如我这里就是 10.0.0.0/8

PinkD commented 1 year ago

我看你给的路由里有 10.30.0.0/16 ,你 ping 的 ip 在这个网段里吗?

PinkD commented 1 year ago

@thurdaypeng 这个问题有解决吗?解决了我就关掉这个 issue 了