PinkD / corplink-rs

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

failed to config interface with uapi for corplink: uapi returns unexpected result: errno=-55 #6

Closed monkey-wenjun closed 1 year ago

monkey-wenjun commented 1 year ago

failed to config interface with uapi for corplink: uapi returns unexpected result: errno=-55

PinkD commented 1 year ago
  1. 系统是什么, linux 还是 win 还是 mac ?
  2. wg-go 是用的修改版吗?
  3. 根据系统,注释掉对应的 .stdout(Stdio::null()).stderr(Stdio::null()) 后重新编译,就能看到 wg-go 返回的报错 https://github.com/PinkD/corplink-rs/blob/9986748727280a88af6efb7cb49d9a5b731b236b/src/wg.rs#L64-L79
monkey-wenjun commented 1 year ago

Manjaro Linux rolling 6位, gnome 42.4 用的是arch 的包直接pacman 安装的

monkey-wenjun commented 1 year ago

start wg-corplink for corplink launch wg-corplink with env: {} socket file /var/run/wireguard/corplink.sock not ready, sleep 1s try to connect unix sock: /var/run/wireguard/corplink.sock send config to uapi failed to config interface with uapi for corplink: uapi returns unexpected result: errno=-55

PinkD commented 1 year ago

下载 3.2 版本,在配置里打开 debug_wg 选项,然后把 wg 相关的 log 发出来看看?

monkey-wenjun commented 1 year ago

login success try to connect found 3 vpn(s) check if udp vpn 11.12.22.3:103 is available available try to get wg conf from remote 2fa code generated: 113381, 22 seconds left start wg-corplink for corplink launch wg-corplink with env: {} socket file /var/run/wireguard/corplink.sock not ready, sleep 1s ┌──────────────────────────────────────────────────────┐ │ │ │ Running wireguard-go is not required because this │ │ kernel has first class support for WireGuard. For │ │ information on installing the kernel module, │ │ please visit: │ │ https://www.wireguard.com/install/ │ │ │ └──────────────────────────────────────────────────────┘ try to connect unix sock: /var/run/wireguard/corplink.sock send config to uapi ERROR: (corplink) 2022/09/06 20:24:09 IPC error -55: failed to set addr to 17.11.0.0/16 for corplink: file exists ERROR: (corplink) 2022/09/06 20:24:09 IPC error -55: failed to set addr to 17.11.0.0/16 for corplink: file exists failed to config interface with uapi for corplink: uapi returns unexpected result: errno=-55

变更了IP信息

PinkD commented 1 year ago

看起来是路由已存在,有两种可能:

  1. 服务端下发的路由有重复的,一般应该不会这么干,可能性比较小
  2. 本机已经有该路由了,可能是 dhcp 或者其他东西添加的。例如公司的 dhcp 服务器可能会自动加这个段,然后再连飞连,就会出现重复的情况。这个比较好排除,你可以在连接之前使用 ip route 命令查看是否有该路由。如果有,可以考虑使用 ip route delete 17.11.0.0/16 删掉
monkey-wenjun commented 1 year ago

感谢支持,找到原因了,docker 的IP段和这个冲突了