All Projects → synfinatic → udp-proxy-2020

synfinatic / udp-proxy-2020

Licence: MIT license
A crappy UDP router for the year 2020 and beyond

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to udp-proxy-2020

AMP-Research
Research on UDP/TCP amplification vectors, payloads and mitigations against their use in DDoS Attacks
Stars: ✭ 246 (+434.78%)
Mutual labels:  udp
okdbc
A fast, light-weight key/value store with http & memcache(TCP/UDP) interface.
Stars: ✭ 28 (-39.13%)
Mutual labels:  udp
iextrading4j-hist
IEX Trading library to parse TOPS and DEEP multicast packets
Stars: ✭ 20 (-56.52%)
Mutual labels:  udp
sx
🖖 Fast, modern, easy-to-use network scanner
Stars: ✭ 1,267 (+2654.35%)
Mutual labels:  udp
Socket-Programming-With-C
✉️ Learn Network Protocol and Network Programming
Stars: ✭ 147 (+219.57%)
Mutual labels:  udp
captcp
A open source program for TCP analysis of PCAP files
Stars: ✭ 110 (+139.13%)
Mutual labels:  udp
GenuineChannels
Collection of custom .NET Remoting channels
Stars: ✭ 29 (-36.96%)
Mutual labels:  udp
aioudp
Asyncio UDP server
Stars: ✭ 21 (-54.35%)
Mutual labels:  udp
laminar
A simple semi-reliable UDP protocol for multiplayer games
Stars: ✭ 717 (+1458.7%)
Mutual labels:  udp
udppunch
udppunch hole for wireguard
Stars: ✭ 123 (+167.39%)
Mutual labels:  udp
netstack
A batteries included networking crate for games.
Stars: ✭ 40 (-13.04%)
Mutual labels:  udp
LiveVideo10ms
Real time video decoding on android
Stars: ✭ 41 (-10.87%)
Mutual labels:  udp
Packet Sender Mobile
iOS and Android version of Packet Sender
Stars: ✭ 58 (+26.09%)
Mutual labels:  udp
HelenaFramework
Modern framework on C++20 for backend/frontend development.
Stars: ✭ 53 (+15.22%)
Mutual labels:  udp
ENet-CSharp
A improved fork of ENet, a tried and true networking library. C, C++, C# compatible.
Stars: ✭ 65 (+41.3%)
Mutual labels:  udp
SpooferBT
Relay torrent tracker communication via TCP to bypass a blocked UDP network.
Stars: ✭ 18 (-60.87%)
Mutual labels:  udp
vtun
A simple VPN written in Go.
Stars: ✭ 592 (+1186.96%)
Mutual labels:  udp
overload
📡 Overload DoS Tool (Layer 7)
Stars: ✭ 167 (+263.04%)
Mutual labels:  udp
lib32100
Library implementing port 32100 UDP Cloud protocol
Stars: ✭ 37 (-19.57%)
Mutual labels:  udp
okhoxi-serac
冰塔协议-传输层协议
Stars: ✭ 33 (-28.26%)
Mutual labels:  udp

udp-proxy-2020

A crappy UDP router for the year 2020 and beyond.

About

What is this for?

So I'm playing with Roon and I've got this complicated home network that throws Roon for a loop. I started debugging things and it turns out Roon sends broadcast messages to UDP/9003. My firewall/router will not forward these messages of course, because that's the right thing to do.

Unfortunately, I really want these broadcast messages to be forwarded to other VLAN/subnets on my local network. I started using udp-proxy-relay-redux which worked great at first.

But I also really like these messages forwarded over my OpenVPN connections which utilize the tun driver which is a point-to-point interface and explicity does not support broadcasts. This didn't work well with udp-proxy-relay-redux because Roon is poorly behaved and still tries sending "broadcasts" to the .255 address which are then dropped on the floor because my VPN server does not have the address x.x.x.255. Basically, on a point-to-point interface, these "broadcasts" were being treated as a packet destined to another host and rightfully ignored.

So what does this do?

Instead of using a normal UDP socket to listen for broadcast messages, udp-proxy-2020 uses libpcap to "sniff" the UDP broadcast messages. This means it can be a lot more flexible about what packets it "sees" so it can then sends them via libpcap/packet injection out all the other configured interfaces. If this makes you go "ew", well, welcome to 2020.

The good news...

I'm writing this in GoLang so at least cross compiling onto your random Linux/FreeBSD router/firewall is reasonably easy. No ugly cross-compling C or trying to install Python/Ruby and a bunch of libraries.

Also: HAHAHAHAHAHAHA! None of that is true! Needing to use libpcap means I have to cross compile using CGO because gopacket/pcapgo only supports Linux for reading & writing to (ethernet?) network interfaces.

Installation & Startup Scripts

Pretty much any Unix-like system is supported because the dependcy list is only libpcap and golang. I develop on MacOS and specifically target pfSense/FreeBSD and Ubiquiti USG, EdgeRouter and DreamMachine/Pro as those are quite common among the Roon user community.

Packages

If you are using a Linux RedHat or Debian based distro, the easiest way to install is grab the appropriate .rpm or .deb file and install it with your package manager. Then edit /etc/udp-proxy-2020.conf and start via: systemctl start udp-proxy-2020.

Docker

There is also a docker image available for Linux on AMD64 and ARM64 (like the Ubiquiti UDM).

Note that for Docker deployments, you should be using host networking.

Manual

I release binaries for Linux, FreeBSD (pfSense) and MacOS for Intel, ARM and MIPS hardware.

There are now instructions and startup scripts available in the startup-scripts directory. If you figure out how to add support for another platform, please send me a pull request!

Usage

Configuration

Run udp-proxy-2020 --help for a current list of command line options.
Also, please note on many operating systems you will need to run it as the root user. Linux systems can optionally grant the CAP_NET_RAW capability.

Currently there are only a few flags you probaly need to worry about:

  • --interface -- Specify two or more network interfaces to listen on.
  • --port -- Specify one or more UDP ports to monitor.
  • --level -- Specify the log level: [trace|debug|warn|info|error]

Advanced options:

  • --fixed-ip -- Hardcode an @ to always send traffic to. Useful for things like OpenVPN in site-to-site mode.
  • --timeout -- Number of ms for pcap timeout value. (default is 250ms)
  • --cache-ttl -- Number of minutes to cache IPs for. (default is 180min / 3hrs) This value may need to be increased if you have problems passing traffic to clients on OpenVPN tunnels if you can't use --fixed-ip because clients don't have a fixed ip.
  • --no-listen -- Do not listen on the specified UDP port(s) to avoid conflicts

There are other flags of course, run ./udp-proxy-2020 --help for a full list.

Example:

udp-proxy-2020 --port 9003 --interface eth0,eth0.100,eth1,tun0 --cache-ttl 300

Would forward udp/9003 packets on four interfaces: eth0, eth1, VLAN100 on eth0 and tun0. Client IP's on tun0 would be remembered for 5 minutes once they are learned.

Note: "learning" requires the client to send a udp/9003 message first! If your application requires a message to be sent to the client first, then you would need to specify --fixed-ip=1.2.3.4@tun0 where 1.2.3.4 is the IP address of the client on tun0.

Building udp-proxy-2020

If you are building for the same platform you intend to run udp-proxy-2020 then you just need to make sure you have libpcap and the necessary headers (you may need a -dev package for that) and run make or gmake as appropriate (we need GNU Make, not BSD Make).

If you need to build cross platform, then one of the following targets may help you:

  • Linux on x86_64 make linux-amd64 via Docker
  • Linux on MIPS64 make linux-mips64 (Linux/MIPS64 big-endian for Ubiquiti USG/EdgeRouter) via Docker
  • Linux on ARM make linux-arm via Docker:
    • Linux on ARM64 for Ubiquiti UDM/UDM Pro
    • Linux on ARMv5 (software floating point)
    • Linux on ARMv6 (hardware floating point)
    • Linux on ARMv7 (hardware floating point)
  • FreeBSD 12.2 on x86_64, ARM64/v6/v7 make freebsd (pfSense 2.5) via Vagrant & VirtualBox
  • Docker image to run udp-proxy-2020 in docker make docker

You can get a full list of make targets and basic info about them by running: make help.

FAQ

When should I use --no-listen?

Starting with v0.0.11, udp-proxy-2020 now by default creates a UDP listening socket on the specified --port(s). This prevents the underlying OS from issuing ICMP Port Unreachable messages which can break certain clients (noteably the Roon iOS client).

The only time you should need to use the --no-listen flag is if there is another piece of software (perhaps your Roon Core?) is running on the same host as udp-proxy-2020. That should be very rare!

When should I use --pcap and --pcap-path?

These flags are for debugging problems with udp-proxy-2020. You should only use these flags when I direct you to do so as part of a ticket you have opened for udp-proxy-2020.

Where can I download precompiled binaries?

From the releases page on Github.

So is it a "proxy"? Are there any proxy config settings I need to configure in my app?

Nope, it's not a proxy. It's more like a router. You don't need to make any changes other than running it on your home router/firewall.

Then why did you call it udp-proxy-2020?

Honestly, I didn't really think much about the name and this was the first thing that came to my mind. Also, naming is hard.

What network interface types are supported?

  • Ethernet
  • WiFi interfaces which appear as Ethernet
  • tun interfaces, like those used by OpenVPN
  • raw interfaces, like those used by Wireguard
  • vti interfaces for site-to-site IPSec

Note that L2TP VPN tunnels on Linux are not compatible with udp-proxy-2020 because the Linux kernel exposes those interfaces as Linux SLL which does not provide an accurate decode of the packets.

How can I get udp-proxy-2020 working with Wireguard on Ubiquiti USG?

So I haven't done this myself, but Bart Verhoeven over on the Roon Community forums wrote up this really detailed how to.

What binary is right for me?

udp-proxy-2020 is built for multiple OS and hardware platforms:

  • MacOS/Intel x86_64: darwin-amd64
  • Linux/Intel x86_64: linux-amd64
  • Linux/ARM64: linux-arm64 (RasPi 2 V1.2 and above, Ubiquiti UniFi Dream Machine)
  • Linux/ARMv7 (hardware floating point): linux-armv7 (RasPi 2 V1.1 and below)
  • Linux/ARMv6 (hardware floating point): linux-armv6
  • Linux/ARMv5 (software floating point): linux-armv5
  • Linux/MIPS64: linux-mips64 (Ubiquiti USG/EdgeRouter)
  • FreeBSD/Intel x86_64: freebsd-amd64 (works with pfSense on x86)
  • FreeBSD/ARMv8: freebsd-arm64 (Netgate SG-1100 & SG-2100)
  • FreeBSD/ARMv7: freebsd-armv7 (Netgate SG-3100)
  • FreeBSD/ARMv6: freebsd-armv6

How can I say thanks?

Honestly, just send me an email saying thanks or "star" this project in GitHub is enough thanks.

Occasionally, someone will ask about giving me a few bucks, but I really don't need any money. If you still would like to throw a few bucks my way, I'd much rather you donate to Second Harvest Food Bank which is local to me and could put your money to better work than I would.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].