mirror of
https://github.com/cbeuw/Cloak.git
synced 2026-04-28 22:15:57 +03:00
[GH-ISSUE #96] 'ck-client -u' crashes with "NumConn": 4 #87
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Cloak#87
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Klaaktu on GitHub (Feb 6, 2020).
Original GitHub issue: https://github.com/cbeuw/Cloak/issues/96
It's an old issue but still happens on latest version (2.1.3).
Tested both OpenVPN (plain text mode) and WireGuard, only
"NumConn": 1works in UDP mode.Client config:
Also is it ok to run OpenVPN in plain text mode to avoid double encryption?
Is "StreamTimeout" idle connection timeout? Can I make it super long to make it only close connection when I Ctrl+C the client like what Shadowsocks recently did?
@Klaaktu commented on GitHub (Apr 26, 2020):
This issue is fixed in master, yay.
Tho OpenVPN seems to be very slow or unable to connect perhaps due to this:
Edit: nvm, it's my shadowsocks session it was closing.
@Klaaktu commented on GitHub (Apr 28, 2020):
It's the build from current master (2.1.3 UDP works fine), TCP mode works very well.
Tho TCP/UDP in OpenVPN probably doesn't matter since the connection in the middle is replaced with Cloak's TCP.
@Weeka89 commented on GitHub (May 14, 2020):
@klaaktu I'm trying to use wireguard through cloak do u mind sharing your steps/config on how to get it done.
@Klaaktu commented on GitHub (May 14, 2020):
@Weeka89 I'm not using WireGuard atm so I don't remember everything, tho the steps are very similar to OpenVPN:
"Endpoint" is ck-client's listening address. In my testing ck-client must be on another PC because of this error in WireGuard.
Failed to send data packet write udp4 0.0.0.0:53457->127.0.0.1:1984: wsasendto: The requested address is not valid in its context.Uncheck "kill-switch" in WireGuard Windows client's config settings, so it can send data to ck-client.It's not necessary unless they are on the same machine.UDP doesn't seem to be working in 2.2.0.
Enable forwarding in server.
@Klaaktu commented on GitHub (May 14, 2020):
WireGuard, server
****:000a & b are unoccupied IPv6 addresses from the server, prefix length 127 because DigitalOcean gives 16 IPs instead of /64 prefix. And their IPv6 is also non-routed thus the ndp-proxy in PostUp.
net.ipv6.conf.eth0.proxy_ndp=1doesn't work if put in sysctl.conf unless it'sallinterface, because Ubuntu... so it's here.WireGuard doesn't seem to have the option to listen on localhost only for incoming traffic.
IPv4 NAT is done in nftables.
WireGuard, client
192.168.1.2 is a second PC running ck-client and dnscrypt-proxy.
Writing "AllowedIPs" like that unchecks the "kill-switch" automatically iirc.
nftables
sysctl.conf
@Klaaktu commented on GitHub (May 14, 2020):
Cloak, server
Cloak, client
Change to
"NumConn": 1and use-uin command line instead of"UDP": trueif using 2.1.3 .WireGuard also seem to have fingerprint, so EncryptionMethod is not plain. (Vanilla WireGuard does get blocked by GFW fairly swiftly.)
@gokaybiz commented on GitHub (Jul 19, 2021):
@klaaktu Hey, how can u handle
route SERVERIP 255.255.255.255 net_gateway
route 192.168.0.0 255.255.0.0 net_gateway
section in wireguard client?
I got failed to establish new connection to remote: dial tcp *****... error.
EDIT: When i remove UDP: true field from config, I got "error reading first packet: read error after connection is established"
@Klaaktu commented on GitHub (Jul 19, 2021):
@gokaybiz
I used WireGuard Windows client which automatically sets up routing (In Linux there is wg-quick which sets ip rules).
I think
SERVERIPasEndpointand exclude 192.168.0.0/16 inAllowedIPsshould suffice.(Though if using Cloak,
SERVERIPshouldn't be the public address of the server but ck-client listening address, and ck-client can't be on the same PC as WG)@gokaybiz commented on GitHub (Oct 2, 2021):
Why we can't use on same pc?
I tried to exclude my server's ip.
But Wireguard couldn't do handshake.
WHY?
Here is some log from ck-client:
@cbeuw ?
@Klaaktu commented on GitHub (Oct 3, 2021):
Does WireGuard say...?
I vaguely remember the explanation "localhost interface is not valid" somewhere. However the answer I get from search now is to set the
Endpointto IP address of the machine (private/public but not 127.0.0.1) due to "strong host model".I'm currently using shadowsocks (hard to connect atm...) tproxy/tun to avoid double tunnel, so I don't have Wireguard set up to test it.