Code Monkey home page Code Monkey logo

udptunnel's People

Contributors

rfc1036 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

udptunnel's Issues

setup_udp_recv: bind: Address in use

# udptunnel -v -s 4096 127.0.0.1:55820
Listening for TCP connections on port 4096
setup_udp_recv: bind: Address in use

But netstat doesn't show any instance of port 4096. I'm not using it for anything.

So I tried many different ports, but still udptunnel thinks they're all in use.

Any idea?

OpenWrt 23.05.2 (ramips/mt7621 architecture)
udptunnel 1.1-1 installed with opkg.

Fail to start while using socket-activated mode

System: Debian 5.5.17-1~bpo10+1 (2020-04-23) x86_64 GNU/Linux
systemd ver: 241 (241)

By using udptunnel-(client|server).(service|socket) with nearly its original version, I tried to start udptunnel-(client|server).socket.

  • The systmed files of client and server are on different VMs.
  • The only change I did is deleting the line ListenStream=[::]:443.

At this time, the status was ok. They were active.

Then, I executed the command mtr -T 127.0.0.1 -P 443 on the server VM, and I executed the journalctl -xe after then. I paste the critical log here:

-- Automatic restarting of the unit udptunnel-server.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
systemd[1]: Stopped udptunnel server.
-- Subject: Unit udptunnel-server.service has finished shutting down
-- Defined-By: systemd
-- 
-- Unit udptunnel-server.service has finished shutting down.
systemd[1]: Failed to set devices.allow on /system.slice/udptunnel-server.service: Operation not permitted
systemd[1]: Failed to set devices.allow on /system.slice/udptunnel-server.service: Operation not permitted
systemd[1]: Starting udptunnel server...
-- Subject: Unit udptunnel-server.service has begun start-up
-- Defined-By: systemd

-- Unit udptunnel-server.service has begun starting up.
udptunnel[29419]: Expected 2 argument(s)!
udptunnel[29419]: Usage: udptunnel [OPTION]... [[SOURCE:]PORT] DESTINATION:PORT
udptunnel[29419]: -s    --server         listen for TCP connections
udptunnel[29419]: -i    --inetd          expect to be started by inetd
......
udptunnel[29419]: SOURCE:PORT must not be specified when using inetd or socket activation.
udptunnel[29419]: If the -s option is used then the program will listen on SOURCE:PORT for TCP
udptunnel[29419]: connections and relay the encapsulated packets with UDP to DESTINATION:PORT.
udptunnel[29419]: Otherwise it will listen on SOURCE:PORT for UDP packets and encapsulate
udptunnel[29419]: them in a TCP connection to DESTINATION:PORT.
systemd[1]: udptunnel-server.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
systemd[1]: udptunnel-server.service: Failed with result 'exit-code'.
systemd[1]: Failed to start udptunnel server.
-- Subject: Unit udptunnel-server.service has failed
-- Defined-By: systemd


-- Unit udptunnel-server.service has finished shutting down.
systemd[1]: udptunnel-server.service: Start request repeated too quickly.
systemd[1]: udptunnel-server.service: Failed with result 'exit-code'.
systemd[1]: Failed to start udptunnel server.
-- Subject: Unit udptunnel-server.service has failed
-- Defined-By: systemd
-- 
-- Unit udptunnel-server.service has failed.
-- 
-- The result is RESULT.
systemd[1]: udptunnel-server.socket: Failed with result 'service-start-limit-hit'.

The situation for the client VM was nearly the same. I suppose I do not need to duplicate it.

Trying to search what exactly happened for hours but failed.

tunnel won't run

root@Helsinki:~# udptunnel -s 444 -v 127.0.0.1/433
Listening for TCP connections on port 444
setup_udp_recv: bind: Address already in use

why is that?
which port is in use?
I got confused, it should accepts tcp packets on port 444 and forward them on udp port 433 on the server which another process is listening to(433 UDP)
there is no process listening on port 444.

Need help to run the tunnel

root@Helsinki:~# udptunnel -s 444 -v 127.0.0.1/433
Listening for TCP connections on port 444
setup_udp_recv: bind: Address already in use

Newbie here.
Correct me if I'm wrong, the above command will accept any incoming TCP traffic on port 444 and then forward that traffic to UDP port 433 on the server, and on the server there should be a process listening to UDP port 433 to get traffic for further process.
If I change 127.0.0.1/433 to 127.0.0.1/436 for example, the command will run without any problem, but there is no process listening on port 436 to get traffic.

sendto(udp): Invalid argument

Server side (192.168.1.106), OpenBSD 7.4, arm64:

# udptunnel -s -v 0.0.0.0:4096 127.0.0.1:51820

Client side (192.168.1.151), Linux, glibc, amd64:

# udptunnel -v 0.0.0.0:51820 192.168.1.106:4096

The server keeps dropping the client. See server logs below.

Received a TCP connection from 192.168.1.151:58656
sendto(udp): Invalid argument
Received a TCP connection from 192.168.1.151:60566
sendto(udp): Invalid argument
Received a TCP connection from 192.168.1.151:46066
sendto(udp): Invalid argument

Multipath TCP Support

Do you have any obligations against supporting Multipath TCP for the transport? I'm looking forward to use this as a "proxy" for wireguard over mTCP (I know, kinda hacky setup)

If it's okay for you, I'd add mTCP support that came with the newer kernel revisions

Bind logic fails when net.ipv6.bindv6only is 0

Hello, I am referring to this gist. I've also seen here issues about address is already in use. I want to talk about it.

First of all, I want to mention that net.ipv6.bindv6only = 0 is fairly legal for every Linux system because many developers may forget about ipv6, and this option should be enabled globally by default. This option enables binding to both 0.0.0.0 and :: when bind has been called with just 0.0.0.0. It allows programs to bind to IPv6 automatically.

So I am going to provide a pull request that will add the IPV6_V6ONLY option for socket when we are working with ipv6 protocol, because the current bind logic actually implies it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.