synfinatic / udp-proxy-2020

A crappy UDP router for the year 2020 and beyond
MIT License
106 stars 7 forks source link

UDP : udp-proxy-2020 container started but not working #82

Closed djgigi closed 2 years ago

djgigi commented 2 years ago

Hello, With startup-scripts/udm-utilities/, no problem to execute the container. image

But udp-proxy-2020 is not running in reallity on my UDM image

Does anyone have an explanation? Thanks

synfinatic commented 2 years ago

It's not clear, but are you running ./udp-proxy-2020 --help from inside of the container? what directory are you in?

djgigi commented 2 years ago

Oups sorry, but thanks for the fast feedback

That I'm here: /mnt/data/udp-proxy-2020/ image

Or here, it's the same: /mnt/data/on_boot.d/ image

But I may not be looking in the right place, I don't know where the container was installed

synfinatic commented 2 years ago

It is installed at /usr/local/bin/udp-proxy-2020 inside of the docker container you're running. You shouldn't be running it from the UDM root account directly. The startup scripts start the container which starts udp-proxy-2020.

djgigi commented 2 years ago

Thanks so I found it: image

On the other hand is it normal that it is there 2 times at different locations?

Because my wirerguard works correctly, but unfortunately not possible to see my smartphone in roon, and .conf file is right

synfinatic commented 2 years ago

udp-proxy-2020 isn't a shell script. you can't run /bin/sh udp-proxy-2020 which is why you keep getting errors.

Honestly, you keep asking questions which are not ever going to help you. I don't know what you're trying to do, but I can tell you're doing it wrong. If you want help, you're going to need to stop and start from the beginning. A good start would be explaining your setup, sharing your config file and the logs of udp-proxy-2020 running in the container.

djgigi commented 2 years ago

Yes thank you it will indeed be better to do as you say to understand why it does not work on my system.

My router is a UDM firmware 1.11 running wireguard, Firewall ruels, exactly like on this link https://github.com/boostchicken-dev/udm-utilities/wiki/Run-a-Wireguard-VPN-server-on-UDM-Pro

udp-proxy-2020.conf: udp-proxy-2020.conf.txt

Log file: udp-proxy-2020.log

The difficulty in explaining the problem, is that when I enable the podman logs on udp-proxy-2020, my phone connects without any problem, but when I try without enabling it, Roon does not see my smartphone.

I hope I was able to transmit the right information, but sorry I don't know much about it

Thanks again for your time

synfinatic commented 2 years ago

So I see some indication of things working correctly based on the logs. To really help further I really need to finish #79 so I can see the network traffic.

Also, would help if I knew the IP address of your Roon Core and the remote device connecting over wireguard (the vpn tunnel interface).

djgigi commented 2 years ago

Impatient then, because the functionality of udp-proxy-2020 is really great. But for it to work, I have to run a podman logs via ssh first, otherwise my smartphone is not detected by Roon.

Roon core : 192.168.1.35 smartphone : 192.168.240.3

synfinatic commented 2 years ago

"But for it to work, I have to run a podman logs via ssh first, otherwise my smartphone is not detected by Roon."

So it does work, but you have to run a podman logs command on the UDM first? Because that doesn't sound at all like a udp-proxy-2020 issue at all. It sounds like an issue how you have something configured with udm-utilities or with how the docker container starts or something like that.

Are you sure the udp-proxy-2020 container is starting correctly when you boot your UDM? It should be doing so after the wireguard container, because otherwise the wg0 interface doesn't exist yet. I now notice in your first comment in this ticket that I don't see the Wireguard container running... so that might explain it?

djgigi commented 2 years ago

I run wireguard not via a container, but via this method. https://github.com/tusc/wireguard-kmod

Then I start wireguard manually before udp-proxy-2020.

But the procedure by podman logs command only works once, because if I reboot my phone, it doesn't work anymore.

But indeed all this can be due to udm-utilities. I'll look into it too. Thanks

djgigi commented 2 years ago

I wanted to start from a scratch, so I did a factory reset on my UDM. I reinstalled wireguard via UDM-utilities this time without any problem and working fine also after the UDM reboot. image

But with 40-udp-proxy-2020.sh, I now get this error message, as if it could not find the docker...

image

So completely due to something else I guess, any idea ?

synfinatic commented 2 years ago

No idea.... I haven't changed anything on my end.

djgigi commented 2 years ago

Problem solved, I had to change the TAG to really put the name of the last version

`#!/bin/sh

CONTAINER=udp-proxy-2020 # name of the container TAG=v0.0.8 # tag to use for docker image

. /mnt/data/udp-proxy-2020/udp-proxy-2020.conf `

Thank you so much for this nice program

synfinatic commented 2 years ago

So it is working now?

djgigi commented 2 years ago

Unfortunately not.... But the docker images are automatically loaded when UDM is rebooted, so probably not a problem with udm-utilities

image

But Roon doesn't see my smartphone. although it's not always true, sometimes it sees it, but it's really random, I can try 10 times and leave roon open for 2 to 3 minutes without detection, and at the 11th time the smartphone is detected instantly.

And nothing to do with the execution of podma logs anymore :-(

synfinatic commented 2 years ago

So I recently updated to the latest Roon build on my Mac and basically Roon had lots of problems with discovery until I rebooted my Mac (I also restarted my Core, but not sure if that helped??). No idea why. You might try rebooting your phone & core and see if that helps.

Anyways, I have started working on the pcap capture thing so I can better diagnose issues like this.... I've tried asking people to run tcpdump in the past for this sorta thing and honestly, it's just way too painful for everyone involved. Hopefully I'll have something soon for you to try out.

In the mean time, I notice the version of the wireguard-go docker image you're running is bit old (there is a newer version that is less than a month old) so you might try that.

djgigi commented 2 years ago

Thanks @synfinatic, I rebooted my NUC, and my phone, but the connection is still random. And great eye, I updated Wireguard-go thanks to you.

All the best and thanks again

synfinatic commented 2 years ago

So I added a new docker image on hub.docker.io you'll need to change the tag from latest to v0.0.9 here: https://github.com/synfinatic/udp-proxy-2020/blob/main/startup-scripts/udm-utilities/on_boot.d/40-udp-proxy-2020.sh#L5

You also need to modify this command here: https://github.com/synfinatic/udp-proxy-2020/blob/main/startup-scripts/udm-utilities/on_boot.d/40-udp-proxy-2020.sh#L31

    podman run -i -d --rm --net=host --name ${CONTAINER} \
        --mount=type=bind,source=/root,destination=/pcaps \
        -e PORTS=${PORTS} -e INTERFACES=${INTERFACES} \
        -e TIMEOUT=${TIMEOUT} -e CACHETTL=${CACHETTL} \
        -e EXTRA_ARGS="${EXTRA_ARGS}  --pcap --pcap-path=/pcaps" \
        synfinatic/udp-proxy-2020:${TAG}

The above source=/root should point at the home directory of the user you ssh into the UDM as. I just guessed /root in this case since that is the typical root home directory.

Once you start the container, it will start writing pcap files and do so as long as it is running. The good news is it should only write packets for udp/9003 so it shouldn't eat a ton of disk space, but I definitely don't recommend running it like this normally.

Please make sure to "force quit" the Roon app on your phone and then connect to the VPN and then start Roon. The Roon app sometimes caches old bad data and won't try to re-discover again, so it's important to start fresh. Once you have gotten the error from the phone saying it can't connect, shutdown the docker container, grab the pcap files, put them in a zip file and attach it to this ticket.

djgigi commented 2 years ago

Great, you did it!

I did the installation, everything goes without problem, but there must be a bug because the image stop instantly, because I dont see it after installation: image

This is my script file : 40-udp-proxy-2020.txt

FYI, I am well logged in as root image

synfinatic commented 2 years ago

need some logs or something from podman to know why it is failing. Did you verify /root ?

djgigi commented 2 years ago

this is beyond my sympathy, I don't know how to find the log, since the image doesn't work...

I tried this: image

then with the image ID found : image

and regarding your /root question image image I do not see the creation of any folder /pcaps

synfinatic commented 2 years ago

yeah, it won't create a /pcaps directory...

as for podman logs, have you looked in /var/log/messages or other files in /var/log? or maybe ask on community.ui.com how to diagnose a container not starting??? there should be logs somewhere.

synfinatic commented 2 years ago

just checking in on this ticket. if you don't need any more assistance then I'm going to close it.

djgigi commented 2 years ago

Sorry for not giving any sign of life, but no, the problem is not solved, but I did not receive any answer from community.ui.com.

FYI, I can't install versions 0.0.9 or 0.0.11 of udp-proxy-2020 on my UDM. so I continue with version 0.0.8 which works randomly. Hopefully someone with a UDM and better computer skills will encounter the same problem and find a solution....

synfinatic commented 2 years ago

don't think there is anything else I can do here since I don't have a UDM so going to close this ticket.