You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Peformance improvements, bug fixes, and reverse port forwarding (#23)
* Replace DNAT with TCP Forwarder
* Use transport forwarders in place of DNAT
* Add option to disable ipv6
* Remove magic number check
* Fix flags
* Implement basic port forwarding
* Add basic reverse socks support
* Update README.md
Copy file name to clipboardExpand all lines: README.md
+55-11
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ In this diagram, the client has generated and installed WireGuard configuration
16
16
17
17
1. Download binaries from the [releases](https://github.com/sandialabs/wiretap/releases) page, one for your client machine and one for your server (if different os/arch)
18
18
2. Run `./wiretap configure --port <port> --endpoint <socket> --routes <routes>` with the appropriate arguments
19
-
3. Import the resulting `wiretap_relay.conf` and `wiretap_e2ee.conf` files into WireGuard on the client machine
19
+
3. Import the resulting `wiretap.conf` and `wiretap_relay.conf` files into WireGuard on the client machine
20
20
4. Copy and paste the server command output that best suits your target system into Wiretap on the server machine
21
21
5. Add more servers and clients as needed with the `add` subcommand
> Wiretap uses 2 WireGuard interfaces per node in order to safely and scalably chain together servers. This means your client will bind to more than one port, but only the Relay Interface port needs to be accessible by the Server. See the [How It Works](#how-it-works) section for details. Use `--simple` if your setup requires a single interface on the client
107
107
108
-
Install the resulting config either by copying and pasting the output or by importing the new `wiretap_relay.conf` and `wiretap_e2ee.conf` files into WireGuard:
108
+
Install the resulting config either by copying and pasting the output or by importing the new `wiretap.conf` and `wiretap_relay.conf` files into WireGuard:
109
109
110
110
* If using a GUI, select the menu option similar to *Import Tunnel(s) From File*
111
-
* If you have `wg-quick` installed, `sudo wg-quick up ./wiretap_relay.conf` and `sudo wg-quick up ./wiretap_e2ee.conf`
111
+
* If you have `wg-quick` installed, `sudo wg-quick up ./wiretap.conf` and `sudo wg-quick up ./wiretap_relay.conf`
112
112
113
-
Don't forget to disable or remove the tunnels when you're done (e.g., `sudo wg-quick down ./wiretap_relay.conf` and `sudo wg-quick down ./wiretap_e2ee.conf`)
113
+
Don't forget to disable or remove the tunnels when you're done (e.g., `sudo wg-quick down ./wiretap.conf` and `sudo wg-quick down ./wiretap_relay.conf`)
114
114
115
115
### Deploy
116
116
@@ -176,7 +176,7 @@ If you plan to attach a server directly to the client, the status command just c
176
176
Configurations successfully generated.
177
177
Import the updated config(s) into WireGuard locally and pass the arguments below to Wiretap on the new remote server.
The client's E2EE configuration will be modified, so you need to reimport it. For example, `wg-quick down ./wiretap_e2ee.conf` and `wg-quick up ./wiretap_e2ee.conf`. If you are attaching a server directly to the client, the Relay interface will also need to be refreshed.
206
+
The client's E2EE configuration will be modified, so you need to reimport it. For example, `wg-quick down ./wiretap.conf` and `wg-quick up ./wiretap.conf`. If you are attaching a server directly to the client, the Relay interface will also need to be refreshed.
207
207
208
208
Now you can use any of the server command options to deploy Wiretap to the new server. It will then connect to the already existing server.
209
209
@@ -258,7 +258,7 @@ The `add client` subcommand can be used to share access to the Wiretap network w
258
258
> **Note**
259
259
> All servers must be deployed *before* adding additional clients
260
260
261
-
Adding a client is very similar to the other commands. It will generate a `wiretap_relay.conf` and `wiretap_e2ee.conf` for sharing. Make sure that all of the first-hop servers (any server directly attached to the original client) can reach or be reached by the new client. Once you get the endpoint information from whoever will be running the new client run:
261
+
Adding a client is very similar to the other commands. It will generate a `wiretap.conf` and `wiretap_relay.conf` for sharing. Make sure that all of the first-hop servers (any server directly attached to the original client) can reach or be reached by the new client. Once you get the endpoint information from whoever will be running the new client run:
Send these files and have the recipient import them into WireGuard to have access to everything in the Wiretap network! By default the routes (AllowedIPs) are copied over, but can be modified by the recipient as needed.
305
305
306
+
### Port Forwarding
307
+
308
+
> **Warning**
309
+
> Port forwarding exposes services on your local machine to the remote network, use with caution
310
+
311
+
You can expose a service on the client by using the `expose` subcommand. For example, to allow remote systems to access port 80/tcp on your local machine, you could run:
312
+
313
+
```
314
+
./wiretap expose --local 80 --remote 8080
315
+
```
316
+
317
+
Now all Wiretap servers will be bound to port 8080/tcp and proxy connections to your services on port 80/tcp. By default this uses IPv6, so make sure any listening services support IPv6 as well.
318
+
To configure Wiretap to only use IPv4, use the `configure` subcommand's `--disable-ipv6` option.
319
+
320
+
To dynamically forward all ports using SOCKS5:
321
+
322
+
```
323
+
./wiretap expose --dynamic --remote 8080
324
+
```
325
+
326
+
All servers will spin up a SOCKS5 server on port 8080 and proxy traffic to your local machine and can be used like this:
The destination IP will be rewritten by the server so you can put any address.
333
+
334
+
#### List
335
+
336
+
Use `./wiretap expose list` to see all forwarding rules currently configured.
337
+
338
+
#### Remove
339
+
340
+
Use `./wiretap remove` with the same arguments used in `expose` to delete a rule. For example, to remove the SOCKS5 example above:
341
+
342
+
```
343
+
./wiretap expose remove --dynamic --remote 8080
344
+
```
345
+
306
346
## How It Works
307
347
308
348
A traditional VPN can't be installed by unprivileged users because VPNs rely on dangerous operations like changing network routes and working with raw packets.
@@ -329,6 +369,7 @@ Usage:
329
369
Available Commands:
330
370
add Add peer to wiretap
331
371
configure Build wireguard config
372
+
expose Expose local services to servers
332
373
help Help about any command
333
374
ping Ping wiretap server API
334
375
serve Listen and proxy traffic into target network
@@ -353,9 +394,12 @@ Use "wiretap [command] --help" for more information about a command.
353
394
- TCP
354
395
- Transparent connections
355
396
- RST response when port is unreachable
397
+
- Reverse Port Forward
398
+
- Reverse Socks5 Support
356
399
- UDP
357
400
- Transparent "connections"
358
401
- ICMP Destination Unreachable when port is unreachable
402
+
- Reverse Port Forward
359
403
* Application
360
404
- API internal to Wiretap for dynamic configuration
361
405
- Chain servers together to tunnel traffic through an arbitrary number of machines
@@ -460,7 +504,7 @@ Install the newly created WireGuard configs with:
460
504
461
505
```bash
462
506
wg-quick up ./wiretap_relay.conf
463
-
wg-quick up ./wiretap_e2ee.conf
507
+
wg-quick up ./wiretap.conf
464
508
```
465
509
466
510
Copy and paste the Wiretap arguments printed by the configure command into the server machine prompt. It should look like this:
@@ -540,7 +584,7 @@ To bring down the WireGuard interfaces on the client machine, run:
0 commit comments