diff --git a/README.md b/README.md index 7bd766366bb92bb59c152c9a39877d72671e88d9..70c9f0cf012af2f250b507f4e3d0a63d6966ce8d 100644 --- a/README.md +++ b/README.md @@ -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`): -```ssh -Host dnc/* - IdentityFile /home/<local_user>/.ssh/<key>.pub - ProxyCommand /home/<local_user>/dhtnet/build/dnc -I /home/<local_user>/.dhtnet/client $(basename %h) -``` -#### Setting up the Server (Listening) -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: -```sh -ssh <ssh_remote_user>@dnc/<peer_id> -``` -For example: -```sh -ssh mypeer@dnc/2f4975e7b11a0908bd400b27130fe9a496d0f415 -``` ### [Dsh: Distributed shell](tools/dsh/README.md) 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: -```sh -dsh -I /home/<local_user>/.dhtnet/client <peer_id> -``` ### [Dvpn: Distributed VPN](tools/dvpn/README.md) -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: -```sh -sudo dvpn -I /home/<local_user>/.dhtnet/client <peer_id> -``` +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: DHTNet Certificate Manager](tools/dhtnet_crtmgr/README.md) +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. ## Report issues diff --git a/tools/dsh/README.md b/tools/dsh/README.md index b18acbb346b2024cce43bce8bae5a62f74c71b9f..a6098b8f33fd0a26e43700a77291af58083e997d 100644 --- a/tools/dsh/README.md +++ b/tools/dsh/README.md @@ -14,16 +14,22 @@ **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. +- `-a, --anonymous_cnx`: Activate anonymous connection mode. + +For example, to connect to a remote peer and specify a custom configuration in the YAML configuration file, you can use the following command: ```shell -dsh -b <BOOTSTRAP_ADDRESS> -s <BINARY_PATH> -I <IDENTITY_PATH> <PEER_ID> +dsh -d <configuration> <peer_identifier> ``` \ No newline at end of file diff --git a/tools/dvpn/README.md b/tools/dvpn/README.md index d0bbb39bfdada9920aa66ce4bdeeaf83a0f8feae..1cf48a10ea459ec3e7e1692ce0d2756964a2c269 100644 --- a/tools/dvpn/README.md +++ b/tools/dvpn/README.md @@ -14,22 +14,7 @@ ## Configuration -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. +- `-a, --anonymous_cnx`: Activate anonymous connection mode. To run a dvpn server, you can use the following command: ```shell @@ -57,7 +44,7 @@ sudo ./dvpn -l To connect to a dvpn server, you can use the following command: ```shell -sudo ./dvpn <PEER_ID> +sudo ./dvpn <server_identifier> ``` **Note**: **dvpn** requires sudo privileges to create and configure TUN interfaces on both the client and server sides.