@@ -103,72 +103,22 @@ DHTNet depends on the following libraries:
### [Dnc: Distributed nc](tools/dnc/README.md)
dnc is a command-line program that provides network connectivity between peers in a Distributed Hash Table (DHT) network. It allows peers to establish connections with other peers and create a TCP socket on a remote devices, similar to the behavior of the traditional nc utility.
#### SSH configuration
To simplify the usage of dnc with SSH, you can add the following lines to your SSH configuration file (`~/.ssh/config`):
On the server side, run **dnc** in listen mode to accept incoming connections:
```sh
dnc -l
```
This command instructs dnc to listen for incoming connections and will also print its own ID.
#### Connecting from the Client
On the client side, you can use the "dnc" alias you defined earlier to connect to a remote server. Replace <peer_id> with the actual peer ID you want to connect to, and <ssh_remote_user> with the SSH remote user you intend to use:
dsh is a Distributed Shell command-line program that enables peers to establish connections with other peers in a Distributed Hash Table (DHT) network and execute a binary on the remote target.
#### Setting up the Server (Listening) and Default Command
To set up tahe dsh server to listen for incoming connections and execute bash by default if no file is specified, execute the following command on the server:
```sh
dsh -l
```
#### Connecting from the Client
Replace <peer_id> with the actual peer ID you want to connect to:
dvpn is a powerful VPN tool built on the foundation of the DHTNet library. dvpn supports both server and client modes, offering flexibility in deployment sceanrios.
Before using dvpn, please fellow the [configuration instractions](tools/dvpn/README.md#configuration).
#### Setting up the Server (Listening)
To set up a dvpn server to listen for incoming connections, execute the following command on the server:
```sh
sudo dvpn -l
```
#### Connecting from the Client
Replace <peer_id> with the actual peer ID you want to connect to:
dvpn is a VPN tool built on the foundation of the DHTNet library. dvpn supports both server and client modes, offering flexibility in deployment sceanrios.
**Note**: **dvpn** requires sudo privileges to create and configure TUN interfaces on both the client and server sides.
dhtnet-crtmgr is a command-line tool designed to manage certificates for the DHTNet network. It provides functionality for generating and signing certificates.
### Using Different Certificates
If the client and server are on the same machine, they should use different certificates for authentication, so make sure to specify different identity file paths for the client and server. This ensures that they use separate certificates. In the examples above, we specified the client's identity file path as /home/<local_user>/.dhtnet/client
If the client and server are on the same machine, they should use different certificates for authentication, so make sure to specify different identity file paths for the client and server. This ensures that they use separate certificates.
**dsh** accepts the following command-line options:
-`-h, --help`: Display help information for using **dsh**.
-`-V, --version`: Display the version information of **dsh**.
-`-l, --listen`: Run **dsh** in listen mode, allowing the program to accept incoming network connections and perform network-related tasks on request.
-`-b, --bootstrap <BOOTSTRAP_ADDRESS>`: Specify the address of a bootstrap node to connect to an existing DHT network. This option requires an argument. The default value is "bootstrap.jami.net" if not specified.
-`-s, --binary <BINARY_PATH>`: Specify the path to the binary that should be executed on the remote target when a connection is established. This option requires an argument. The default value is "bash" if not specified.
-`-I, --id_path <IDENTITY_PATH>`: Specify the path to the identity file, which contains information about the peer's identity and is used for DHT network interactions. This option requires an argument. The default value is "~/.dhtnet" if not specified.
-`<PEER_ID>`: The peer ID argument is required when not running in listen mode. It specifies the ID of the target peer or device in the DHT network with which the connection should be established.
For example, to connect to a remote peer and specify a custom bootstrap node, binary, and identity file, you can use the following command:
-`-h, --help`: Show the help message and exit.
-`-v, --version`: Display the version of the program.
-`-l, --listen`: Launch the program in listen mode, waiting for incoming connections.
-`-b, --bootstrap [ADDRESS]`: Specify the address of the bootstrap node for DHT network initialization.
-`-s, --binary [PATH]`: Specify the binary to execute upon establishing a connection.
-`-p, --privateKey [PATH]`: Define the path to the private key.
-`-c, --certificate [PATH]`: Specify the path to the certificate.
-`-t, --turn_host [HOST]`: Define the TURN server host for NAT traversal.
-`-u, --turn_user [USERNAME]`: Specify the TURN server username for authentication.
-`-w, --turn_pass [PASSWORD]`: Define the TURN server password for authentication.
-`-r, --turn_realm [REALM]`: Specify the TURN server realm for additional security.
-`-d, --configuration [PATH]`: Define the path to the YAML configuration file for dsh.
Before using **dvpn**, make sure to disable IPv6. To disable IPv6, follow these steps:
1. Open the terminal.
2. Edit the `/etc/sysctl.conf` file using a text editor.
3. Add the following lines at the end of the file:
```shell
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
```
4. Save the file and exit the text editor.
5. Apply the changes by running the following command:
```shell
sudo sysctl -p
```
Additionally, follow these steps to update your configuration:
Before using **dvpn**, follow these steps to update your configuration:
1. Locate the default configuration file at `dhtnet/tools/dvpn/test_config.yaml`.
2. Update the `script_path` section by providing the absolute path for the `dvpn_up.sh` file.
...
...
@@ -41,14 +26,16 @@ Additionally, follow these steps to update your configuration:
-`-h, --help`: Display help information
-`-V, --version`: Display the version information of **dvpn**.
-`-l, --listen`: Run **dvpn** in listen mode, allowing the program to accept incoming VPN connections.
-`-b, --bootstrap <BOOTSTRAP_ADDRESS>`: Specify the address of a bootstrap node to connect to an existing DHT network. This option requires an argument. The default value is "bootstrap.jami.net" if not specified.
-`-I, --id_path <IDENTITY_PATH>`: Specify the path to the identity file, which contains information about your identity and is used for DHT network interactions. This option requires an argument. The default value is "$HOME/.dhtnet" if not specified.
-`-t, --turn_host <TURN_SERVER>`: Specify the hostname or IP address of the TURN (Traversal Using Relays around NAT) server to use for network traversal. This option requires an argument. The default value is "turn.jami.net" if not specified.
-`-u, --turn_user <TURN_USERNAME>`: Specify the username for authentication with the TURN server. This option requires an argument. The default value is "ring" if not specified.
-`-w, --turn_pass <TURN_PASSWORD>`: Specify the password for authentication with the TURN server. This option requires an argument. The default value is "ring" if not specified.
-`-r, --turn_realm <TURN_REALM>`: Specify the realm for authentication with the TURN server. This option requires an argument. The default value is "ring" if not specified.
-`-c, --configuration_path_file <CONF_PATH>`: Specify the path to the configuration file. The default value is "dhtnet/tools/dvpn/test_config.yaml" if not specified.
-`<PEER_ID>`: The peer ID argument is required when not running in listen mode. It specifies the ID of the target peer or device in the DHT network with which the connection should be established.
-`-b, --bootstrap`: Specify the address of a bootstrap node to connect to an existing DHT network.
-`-t, --turn_host`: Specify the hostname or IP address of the TURN server.
-`-u, --turn_user`: Specify the username for authentication with the TURN server.
-`-w, --turn_pass`: Specify the password for authentication with the TURN server.
-`-r, --turn_realm`: Specify the realm for authentication with the TURN server.
-`-C, --vpn_configuration`: Specify the path to the vpn configuration file.
-`-p, --privateKey`: Define the path to the private key.
-`-c, --certificate`: Specify the path to the certificate.
-`-d, --configuration`: Define the path to the YAML configuration file for dvpn.