Skip to content

Quick Start

wangyu- edited this page Jul 5, 2018 · 7 revisions

In this article, we assume you are familiar with original udp2raw, if you are not, check https://github.com/wangyu-/udp2raw-tunnel and come back later.

Basic Usage

Background

Assume you have a servce listening at udp port 7777 of your linux server , but a firewall restricts the udp connection in the middle. Now you want to use udp2raw to bypass the restriction. The system of your local computer is Windows/Mac.

Server Setup

Download and run udp2raw server on VPS, from this address:https://github.com/wangyu-/udp2raw-tunnel/releases

Use following commands:

# Run at server side:
./udp2raw_amd64 -s -l0.0.0.0:4096 -r 127.0.0.1:7777  -a -k "passwd" --raw-mode faketcp

(if you want to keep udp2raw running after ssh exited,google for the usage of either of nohup/screen/tmux)

Client Setup

Install pcap, for details check this link

Download udp2raw clients,from this link .(For some platforms, there might be two files in the tar ball, use the one with _nolibnet suffix. For easier typing, you can remove the suffix of _nolibnet manullay. In the following article, we will assume you have already removed the _nolibnet suffix).

# Run at client side
udp2raw_mp.exe -c -l0.0.0.0:3333  -r44.55.66.77:4096 -k "passwd" --raw-mode easy-faketcp
Note

easy-faketcp is a new mode of udp2raw_mp,its able to commuicate with a server of faketcp,without the need of adding iptables/firewalls rules .

How it looks like now

Server Output

image

Client Output

image

(There is color on my side, because I am using msys2 shell and added the option of --enable-color. If you are using cmd/powershell in windows, there is no color.)

Finish

Everthing is done. Now, connecting to 127.0.0.1:3333 (udp) is equivalent to connecting to udp port 7777 on VPS, every udp packet will be "faked" into tcp, no udp traffic will be exposed.

Advanced Usage

easy-faketcp mode is easy but not optimal. With a few addition steps, you can use the faketcp mode for better performance/stability, its suggested to use faketcp mode.

First , use -g options to generate the needed firwall rules.

udp2raw_mp.exe -c -l0.0.0.0:3333  -r44.55.66.77:4096 -k "passwd" --raw-mode faketcp -g

Expected Outputs:

image

For example , on windows,use:

netsh advfirewall firewall add rule name=udp2raw protocol=TCP dir=in remoteip=44.55.66.77/32 remoteport=4096 action=block
netsh advfirewall firewall add rule name=udp2raw protocol=TCP dir=out remoteip=44.55.66.77/32 remoteport=4096 action=block

Just copy and paste and run。

Delete -g optional ,run udp2raw again:

udp2raw_mp.exe -c -l0.0.0.0:3333  -r44.55.66.77:4096 -k "passwd" --raw-mode faketcp

Done, now you can use the more performanced faketcp mode. In this way, you can also use icmp mode(which turns udp traffic into icmp of course).