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
> Clients added to arbitrary servers do not currently have the same capabilities as clients added to first-hop servers (the default)
625
+
626
+
Clients can be attached to any server in the network by using the `--server-address <api-address>` argument when running `wiretap add client`. This allows a client on a different network than the first client to still gain access to all of the Wiretap network's routes. But this has some limitations.
627
+
628
+
In this example, a new client is added to the second server in the right branch of a Wiretap network. This client will only be able to access routes via the right branch of the network and not the left branch because the branches are only joined through an existing client, which does not route traffic from other clients:
629
+
630
+
```
631
+
┌─────┐
632
+
│ C │
633
+
└┬───┬┘
634
+
│ │
635
+
┌────┴┐ ┌┴────┐
636
+
│ S │ │ S │
637
+
└──┬──┘ └──┬──┘
638
+
│ │
639
+
┌──┴──┐ ┌──┴──┐
640
+
│ S │ │ S ◄───────┐
641
+
└─────┘ └─────┘ │
642
+
┌──┴─┐
643
+
│ C │
644
+
└────┘
645
+
```
646
+
647
+
You may also need to manually edit the resulting `wiretap.conf` for the new client to remove any `AllowedIPs` entries that already exist in the new client's host routing table. If the server that the client is attaching to has a route for 10.2.0.0/16, but the Client already has that route (because that's where it lives), then remove the `10.2.0.0/16` entry from the `wiretap.conf` file before importing into WireGuard. Leave the API address and any other routes you wish to access.
Copy file name to clipboardExpand all lines: src/cmd/add_client.go
+56-6Lines changed: 56 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
package cmd
2
2
3
3
import (
4
+
"errors"
4
5
"fmt"
5
6
"log"
6
7
"net"
@@ -21,6 +22,7 @@ type addClientCmdConfig struct {
21
22
inputConfigFileE2EEstring
22
23
outputConfigFileRelaystring
23
24
outputConfigFileE2EEstring
25
+
serverAddressstring
24
26
mtuint
25
27
}
26
28
@@ -29,6 +31,7 @@ var addClientCmdArgs = addClientCmdConfig{
29
31
inputConfigFileE2EE: ConfigE2EE,
30
32
outputConfigFileRelay: ConfigRelay,
31
33
outputConfigFileE2EE: ConfigE2EE,
34
+
serverAddress: "",
32
35
mtu: MTU,
33
36
}
34
37
@@ -49,6 +52,7 @@ func init() {
49
52
addClientCmd.Flags().StringVarP(&addClientCmdArgs.outputConfigFileE2EE, "e2ee-output", "", addClientCmdArgs.outputConfigFileE2EE, "filename of output E2EE config file")
50
53
addClientCmd.Flags().StringVarP(&addClientCmdArgs.inputConfigFileRelay, "relay-input", "", addClientCmdArgs.inputConfigFileRelay, "filename of input relay config file")
51
54
addClientCmd.Flags().StringVarP(&addClientCmdArgs.inputConfigFileE2EE, "e2ee-input", "", addClientCmdArgs.inputConfigFileE2EE, "filename of input E2EE config file")
55
+
addClientCmd.Flags().StringVarP(&addClientCmdArgs.serverAddress, "server-address", "s", addClientCmdArgs.serverAddress, "API address of server that new client will connect to. By default new clients connect to existing relay servers")
0 commit comments