fscarmen / warp-sh

WARP script is move to: https://gitlab.com/fscarmen/warp
956 stars 205 forks source link

This script affect cloudflared tunnel with degraded performance #70

Closed ikhwanperwira closed 5 months ago

ikhwanperwira commented 5 months ago

When I didn't run warp-sh on my Vps. My cloudflared that installed on VPS got healthy status. But when I ran it, it became degraded. Why? IMG_20240603_221532.jpg

Is it possible caused by working mode? Like global mode and non-global mode. I have no what the option does.

ikhwanperwira commented 5 months ago

Here is log of cloudflared tunnel that being degraded:

2024-06-03T15:20:50Z WRN Unable to establish connection. error="already connected to this server, trying another address" connIndex=2 event=0 ip=198.41.192.37                             2024-06-03T15:20:50Z INF Retrying connection in up to 1m4s connIndex=2 event=0 ip=198.41.192.37                                                                                            2024-06-03T15:20:55Z WRN Failed to create new quic connection error="failed to dial to edge with quic: timeout: no recent network activity" connIndex=3 event=0 ip=198.41.200.63           2024-06-03T15:20:55Z INF Retrying connection in up to 1m4s connIndex=3 event=0 ip=198.41.200.63                                                                                            2024-06-03T15:20:55Z WRN Failed to create new quic connection error="failed to dial to edge with quic: timeout: no recent network activity" connIndex=0 event=0 ip=198.41.200.113          2024-06-03T15:20:55Z INF Retrying connection in up to 1m4s connIndex=0 event=0 ip=198.41.200.113                                                                                           2024-06-03T15:21:02Z WRN Connection terminated error="failed to dial to edge with quic: timeout: no recent network activity" connIndex=0                                                   2024-06-03T15:21:03Z WRN Connection terminated error="failed to dial to edge with quic: timeout: no recent network activity" connIndex=3                                                   2024-06-03T15:21:19Z WRN Connection terminated error="already connected to this server, trying another address" connIndex=2                                                                2024-06-03T15:22:10Z WRN Failed to serve quic connection error="already connected to this server, trying another address" connIndex=2 event=0 ip=198.41.192.107                            2024-06-03T15:22:10Z WRN Unable to establish connection. error="already connected to this server, trying another address" connIndex=2 event=0 ip=198.41.192.107                            2024-06-03T15:22:10Z INF Retrying connection in up to 1m4s connIndex=2 event=0 ip=198.41.192.107                                                                                           2024-06-03T15:22:15Z WRN Failed to create new quic connection error="failed to dial to edge with quic: timeout: no recent network activity" connIndex=0 event=0 ip=198.41.200.43           2024-06-03T15:22:15Z WRN Failed to create new quic connection error="failed to dial to edge with quic: timeout: no recent network activity" connIndex=3 event=0 ip=198.41.200.193          2024-06-03T15:22:15Z INF Retrying connection in up to 1m4s connIndex=0 event=0 ip=198.41.200.43                                                                                            2024-06-03T15:22:15Z INF Retrying connection in up to 1m4s connIndex=3 event=0 ip=198.41.200.193                                                                                           2024-06-03T15:22:18Z WRN Connection terminated error="already connected to this server, trying another address" connIndex=2                                                                2024-06-03T15:22:19Z WRN Failed to serve quic connection error="already connected to this server, trying another address" connIndex=2 event=0 ip=198.41.192.227                            2024-06-03T15:22:19Z WRN Unable to establish connection. error="already connected to this server, trying another address" connIndex=2 event=0 ip=198.41.192.227                            2024-06-03T15:22:19Z INF Retrying connection in up to 1m4s connIndex=2 event=0 ip=198.41.192.227                                                                                           2024-06-03T15:22:29Z WRN Connection terminated error="failed to dial to edge with quic: timeout: no recent network activity" connIndex=3                                                   2024-06-03T15:22:45Z WRN Connection terminated error="failed to dial to edge with quic: timeout: no recent network activity" connIndex=0                                                   2024-06-03T15:22:48Z WRN Connection terminated error="already connected to this server, trying another address" connIndex=2
2024-06-03T15:27:30Z WRN Failed to serve quic connection error="already connected to this server, trying another address" connIndex=2 event=0 ip=198.41.192.107
2024-06-03T15:27:30Z WRN Unable to establish connection. error="already connected to this server, trying another address" connIndex=2 event=0 ip=198.41.192.107
2024-06-03T15:27:30Z INF Retrying connection in up to 1m4s connIndex=2 event=0 ip=198.41.192.107
52024-06-03T15:27:35Z WRN Failed to create new quic connection error="failed to dial to edge with quic: timeout: no recent network activity" connIndex=0 event=0 ip=198.41.200.13
2024-06-03T15:27:35Z WRN Failed to create new quic connection error="failed to dial to edge with quic: timeout: no recent network activity" connIndex=3 event=0 ip=198.41.200.43
2024-06-03T15:27:35Z INF Retrying connection in up to 1m4s connIndex=3 event=0 ip=198.41.200.43
2024-06-03T15:27:35Z INF Retrying connection in up to 1m4s connIndex=0 event=0 ip=198.41.200.13
ikhwanperwira commented 5 months ago

When I setup non-global mode, it's became healthy:

image

I need docs, what's actually happened about Working Mode configuration?

fscarmen commented 5 months ago

If your vps is IPv4 only , You can install warp with IPv6 bash menu.sh 6 and cloudflared run with --edge-ip-version 4. it can run with the native network interface.

https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-run-parameters/#edge-ip-version

ikhwanperwira commented 5 months ago

@fscarmen Thanks for the tips, I understood what happened when I setup with ipv6 only warp and edge IP version on cloudflared.

But, the option working mode like "Global" and "Non-global". What is actually happened? Actually It can be solved so that my tunnel became healthy if I set "Non-global" but degraded for "Global".

fscarmen commented 5 months ago

you should try these

curl -s4m2 ip.sb
curl -s6m2 ip.sb
warp g    # switch global and non-global
curl -s4m2 ip.sb
curl -s6m2 ip.sb
ikhwanperwira commented 5 months ago

Here is the output:

root@bastion:~# warp g

 All dependencies already exist and do not need to be installed additionally.

 Checking VPS infomation...

 Global ---> Non-global, Confirm press [y] : y
 Maximum 5 attempts to get WARP IP...
 Try 1
 Got the WARP Free IP successfully, Working mode: Non-global
 IPv4:104.28.222.46 Singapore Cloudflare, Inc.
 IPv6:2a09:bac1:6520:8::277:33 Singapore Cloudflare Warp
root@bastion:~# curl -s4m2 ip.sb
34.126.178.79
root@bastion:~# curl -s6m2 ip.sb
root@bastion:~# warp g

 All dependencies already exist and do not need to be installed additionally.

 Checking VPS infomation...

 Non-global ---> Global, Confirm press [y] : y
 Maximum 5 attempts to get WARP IP...
 Try 1
 Got the WARP Free IP successfully, Working mode: Global
 IPv4:104.28.222.47 Singapore Cloudflare, Inc.
 IPv6:2a09:bac5:55f9:1d05::2e4:43 Singapore Cloudflare Warp
root@bastion:~# curl -s4m2 ip.sb
104.28.222.43
root@bastion:~# curl -s6m2 ip.sb
2a09:bac5:55f9:1d05::2e4:43
root@bastion:~#  

As far as I know, non-global using default public IP of GCP, while global mode using Cloudflare Public IP.

I understood your curl flag that using specified ip version, but not sure for -m flag.

m2: This sets a maximum time for the whole operation to 2 seconds (-m is short for --max-time). If the command takes longer than 2 seconds, it will be aborted.

I'm wondering why specifying timeout can be different behavior.

fscarmen commented 5 months ago

You can try these . And you will know -m flag.

curl -s4 ip.sb
curl -s6 ip.sb
warp g    # switch global and non-global
curl -s4 ip.sb
curl -s6 ip.sb
ikhwanperwira commented 5 months ago

Here is the output without -m flag. Still same output like above:

root@bastion:~# curl -s4 ip.sb
104.28.222.43
root@bastion:~# curl -s6 ip.sb
2a09:bac5:55f9:1028::19c:16f
root@bastion:~# warp g

 All dependencies already exist and do not need to be installed additionally.

 Checking VPS infomation...

 Global ---> Non-global, Confirm press [y] : y
 Maximum 5 attempts to get WARP IP...
 Try 1
 Got the WARP Free IP successfully, Working mode: Non-global
 IPv4:104.28.222.46 Singapore Cloudflare, Inc.
 IPv6:2a09:bac1:6500:8::1f1:1fa Singapore Cloudflare Warp
root@bastion:~# curl -s4 ip.sb
34.126.178.79
root@bastion:~# curl -s6 ip.sb
ikhwanperwira commented 5 months ago

But atleast I got it why I should use Non-global, the reason is all programs and utilities will not use warp interface by default except I explicitly like this:

root@bastion:~# curl ip.sb
34.126.178.79
root@bastion:~# curl --interface warp ip.sb
104.28.222.43
fscarmen commented 5 months ago

Yes. That is why i let you try above commands. You can understand the different between the global and non.