Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udp2raw screen on server side keeps terminating! #532

Open
Iman-Sh opened this issue Jun 17, 2024 · 6 comments
Open

udp2raw screen on server side keeps terminating! #532

Iman-Sh opened this issue Jun 17, 2024 · 6 comments

Comments

@Iman-Sh
Copy link

Iman-Sh commented Jun 17, 2024

Hi every one, i'm using udp2raw to tunnel both of my servers using screen command and it works amazing but the tunnel in server side keeps terminating a lot and i have to run the command again to make to tunnel work, so is there a way to automatically restart the server side tunnel when udp2raw screen gets terminated?
and how can i figure out what is causing the termination? is there any log?

screen ./udp2raw_amd64 -s -l0.0.0.0:4096 -r127.0.0.1:7777 -k "pass" --raw-mode icmp --log-level 5 -a

screen ./udp2raw_amd64 -c -l0.0.0.0:3333 -r"serverIp":4096 -k "pass" --raw-mode icmp --log-level 5 -a

please let me know if you need more info.

@jearton
Copy link

jearton commented Jun 18, 2024

You can use the docker image: jearton1024/udp2raw

@Iman-Sh
Copy link
Author

Iman-Sh commented Jun 20, 2024

You can use the docker image: jearton1024/udp2raw

ty for your comment, i used the container with this command on server side:
docker run -d \ --name udp2raw_client \ --cap-add NET_ADMIN \ -p 4096:4096/udp \ -p 7777:7777/udp \ -e LISTEN_PORT=4096 \ jearton1024/udp2raw:latest \ -s -l0.0.0.0:4096 \ -r127.0.0.1:7777\ -k "pswd" \ --raw-mode icmp -a
looks ok based on the info that it prints but client cant reach the server and keeps sending handshake and server gets nothing.
1

@jearton
Copy link

jearton commented Jun 25, 2024

@Iman-Sh My best pracetice #531

First start the server-side

Caution: you should use host network on the server-side

use docker compose

services:
  udp2raw_server:
    image: jearton1024/udp2raw:latest
    container_name: udp2raw_server
    restart: unless-stopped
    network_mode: host
    cap_add:
      - NET_ADMIN
    environment:
      - LISTEN_PORT= 4096
    command: >
      -s
      -l0.0.0.0:4096
      -r127.0.0.1:32884
      -k "<password>"
      --raw-mode faketcp
      --fix-gro
      -a

or user docker cli

docker run -d \
  --name udp2raw_server \
  --restart unless-stopped \
  --network host \
  --cap-add NET_ADMIN \
  -e LISTEN_PORT=4096 \
  jearton1024/udp2raw:latest \
  -s \
  -l0.0.0.0:4096 \
  -r127.0.0.1:32884 \
  -k "<password>" \
  --raw-mode faketcp \
  --fix-gro \
  -a

Note that 32884 is the wireguard peer listen port.

Then start the client-side

use docker compose

services:
  udp2raw_client:
    image: jearton1024/udp2raw:latest
    container_name: udp2raw_client
    restart: unless-stopped
    ports: 
      - 51820:51820
    cap_add:
      - NET_ADMIN
    environment:
      - LISTEN_PORT=51820
    command: >
      -c
      -l0.0.0.0:51820
      -r<remote ip>:4096
      -k "<password>"
      --raw-mode faketcp
      -a

or user docker cli

docker run -d \
  --name udp2raw_client \
  --restart unless-stopped \
  -p 51820:51820 \
  --cap-add NET_ADMIN \
  -e LISTEN_PORT=51820 \
  jearton1024/udp2raw:latest \
  -c \
  -l0.0.0.0:51820 \
  -r<remote host>:4096 \
  -k "<password>" \
  --raw-mode faketcp \
  --fix-gro \
  -a

@wangyu-
Copy link
Owner

wangyu- commented Jun 25, 2024

well, this is a linux question instead of a udp2raw question. I suggest to google and solve the problem by yourself.

But... As a friendly reminder:

If you want a simpler solution than docker, you can use either:

nohup

nohup ./udp2raw_amd64 -c -l0.0.0.0:3333 -r"serverIp":4096 -k "pass" --raw-mode icmp --log-level 5 -a &

tmux

tmux 
./udp2raw_amd64 -c -l0.0.0.0:3333 -r"serverIp":4096  -k "pass" --raw-mode icmp --log-level 5 -a (run inside tmux)
(then you are safe to close the ssh)

when ever you want to recall the terminal, you can use tmux attach

@Iman-Sh
Copy link
Author

Iman-Sh commented Jun 27, 2024

well, this is a linux question instead of a udp2raw question. I suggest to google and solve the problem by yourself.

But... As a friendly reminder:

If you want a simpler solution than docker, you can use either:

nohup

nohup ./udp2raw_amd64 -c -l0.0.0.0:3333 -r"serverIp":4096 -k "pass" --raw-mode icmp --log-level 5 -a &

tmux

tmux 
./udp2raw_amd64 -c -l0.0.0.0:3333 -r"serverIp":4096  -k "pass" --raw-mode icmp --log-level 5 -a (run inside tmux)
(then you are safe to close the ssh)

when ever you want to recall the terminal, you can use tmux attach

the problem is not the ssh session because i've used the command inside a screen, i've used tmux before as a replacement for screen but tunnel on server side keeps terminating no matter which one i'm using.
how can i get a log to see what is causing the termination?

@wangyu-
Copy link
Owner

wangyu- commented Jun 28, 2024

the problem is not the ssh session because i've used the command inside a screen, i've used tmux before as a replacement for screen but tunnel on server side keeps terminating no matter which one i'm using.

From you description, I cannot tell whether it's your screen quit unexpectly or your udp2raw quit unexpectly.

if you want to debug

if your screen is still alive, only udp2raw quits. You can recover the screen session and see logs if it's the case 1. udp2raw quit itself bc of some error 2. udp2raw crash.

if you want to keep udp2raw alive

check https://github.com/wangyu-/udp2raw/wiki/keep-udp2raw-alive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants