|
1 | 1 | # udp-redirect
|
2 | 2 | A simple yet flexible and very fast UDP redirector. Tested on Linux x64 and MacOS / Darwin arm64.
|
3 | 3 |
|
4 |
| -Useful for redirecting UDP traffic (e.g., Wireguard VPN, DNS, etc.) where doing it at a different layer (e.g., from a firewall) is challenging / impossible. Does not modify the redirected packets. |
| 4 | +Useful for redirecting UDP traffic (e.g., Wireguard VPN, DNS, etc.) when doing it at a different layer (e.g., from a firewall) is difficult. Does not modify the redirected packets. |
5 | 5 |
|
6 | 6 | Single file source code for convenience.
|
7 | 7 |
|
@@ -77,48 +77,48 @@ Runs in foreground and expects external process control (svscan, nohup, etc.)
|
77 | 77 | | --- | --- | --- | --- |
|
78 | 78 | | ```--verbose``` | | *optional* | Verbose mode, can be specified multiple times. |
|
79 | 79 | | ```--debug``` | | *optional* | Debug mode (e.g., very verbose). |
|
80 |
| -| ```--stats``` | | *optional* | Display send/receive and resource consumption every 60 seconds. | |
| 80 | +| ```--stats``` | | *optional* | Display sent/received bytes statistics every 60 seconds. | |
81 | 81 |
|
82 | 82 | ## Listener
|
83 | 83 |
|
84 |
| -The UDP sender (e.g., wireguard client) sends packets to the UDP redirector here. |
| 84 | +The UDP sender (e.g., wireguard client) sends packets to the UDP redirector specified below. |
85 | 85 |
|
86 | 86 | | Argument | Parameters | Req/Opt | Description |
|
87 | 87 | | --- | --- | --- | --- |
|
88 |
| -| ```--listen-address``` | address | *optional* | Listen address. | |
| 88 | +| ```--listen-address``` | ipv4 address | *optional* | Listen address, defaults to INADDR_ANY. | |
89 | 89 | | ```--listen-port``` | port | **required** | Listen port. |
|
90 | 90 | | ```--listen-interface``` | interface | *optional* | Listen interface name. |
|
91 | 91 | | ```--listen-address-strict``` | | *optional* | **Security:** By default, packets received from the connect endpoint will be sent to the source of the last packet received on the listener endpoint. In ```listen-address-strict``` mode, only accept packets from the same source as the first packet, or the source specified by ```listen-sender-address``` and ```listen-sender-port```. |
|
92 | 92 |
|
93 | 93 | ## Connect
|
94 | 94 |
|
95 |
| -The UDP redirector sends packets here (e.g., to the wireguard server): |
| 95 | +The UDP redirector sends packets to the endpoint specified below. |
96 | 96 |
|
97 | 97 | | Argument | Parameters | Req/Opt | Description |
|
98 | 98 | | --- | --- | --- | --- |
|
99 |
| -| ```--connect-address``` | address | **required** | Connect address. | |
100 |
| -| ```--connect-host``` | address | **required** | Connect host, overwrites ```connect-host``` if both are specified. | |
| 99 | +| ```--connect-address``` | ipv4 address | **required** | Connect address. | |
| 100 | +| ```--connect-host``` | hostname | **required** | Connect host, overwrites ```connect-address``` if both are specified. | |
101 | 101 | | ```--connect-port``` | port | **required** | Connect port. |
|
102 |
| -| ```--connect-address-strict``` | | *optional* | **Security**: Only accept packets from ```connect-host``` / ```connect-port```, otherwise accept from all sources. | |
| 102 | +| ```--connect-address-strict``` | | *optional* | **Security**: Only accept packets from ```connect-host``` and ```connect-port```, otherwise accept from all sources. | |
103 | 103 |
|
104 | 104 | # Sender
|
105 | 105 |
|
106 |
| -The UDP redirector sends packets from here (e.g., to the wireguard server). If any is missing, it will be selected by the operating system (usually ```0.0.0.0```, random port, default interface). |
| 106 | +The UDP redirector sends packets from the local endpoint specified below. If any arguments are missing, it will be selected by the operating system (usually INADDR_ANY, random port, default interface). |
107 | 107 |
|
108 | 108 | | Argument | Parameters | Req/Opt | Description |
|
109 | 109 | | --- | --- | --- | --- |
|
110 |
| -| ```--send-address``` | address | *optional* | Send packets from address. | |
111 |
| -| ```--send-port``` | port | *optional* | Send packets from port. | |
112 |
| -| ```--send-interface``` | interface | *optional* | Send packets from interface. | |
| 110 | +| ```--send-address``` | ipv4 address | *optional* | Send packets from this address. | |
| 111 | +| ```--send-port``` | port | *optional* | Send packets from this port. | |
| 112 | +| ```--send-interface``` | interface | *optional* | Send packets from this interface name. | |
113 | 113 |
|
114 | 114 | # Listener security
|
115 | 115 |
|
116 | 116 | Both must be specified; listener drops packets if they do not arrive from this address / port.
|
117 | 117 |
|
118 | 118 | | Argument | Parameters | Req/Opt | Description |
|
119 | 119 | | --- | --- | --- | --- |
|
120 |
| -| ```--listen-sender-address``` | address | *optional* | Listen endpoint only accepts packets from this source address. | |
121 |
| -| ```--listen-sender-port``` | port | *optional* | Listen endpoint only accepts packets from this source port (must be set together, ```--listen-strict``` is implied). | |
| 120 | +| ```--listen-sender-address``` | ipv4 address | *optional* | Listen endpoint only accepts packets from this source address. | |
| 121 | +| ```--listen-sender-port``` | port | *optional* | Listen endpoint only accepts packets from this source port (must be set together, ```--listen-address-strict``` is implied). | |
122 | 122 |
|
123 | 123 | # Miscellaneous
|
124 | 124 |
|
|
0 commit comments