Option 3: connectd P2P initiator using a provisioning file

connectd allows the use of a provisioning, or configuration, file to allow better organization of multiple P2P connections. Here is a sample provisioning file for a P2P initiator.

Sample P2P provisioning file

Here is an example p2p provisioning file. Copy this to your computer and edit the details.

# setting autoconnect to 1 will autoconnect the p2p initiator to the target
# setting autoconnect to 2 will attempt to automatically reconnect in the event
# of a network interruption
autoconnect 1

#user ID to use for the initiator connection (required)
user_id account@e-mail.com

auth_hash your-authhash
# proxy local IP to bind to, can be, or any local adapter IP

# remote_address is the (UID) address of the target to connect to.
remote_address 80:00:00:00:00:00:00:00

# Maximum buffer depth for each TCP connection (10-25)
# default 12
# raise for high latency environments
max_depth 12
# The number of minutes this proxy should last. Set this to 0 for no limit.
proxylifetime-minutes 0
# The amount of time to wait if there are no active tunnels before terminating the connection.
# Set this to 0 for no limit. The setting for PROXYLIFETIME still applies.
idle-limit 0
# keep this comment line here

Copy and save this text to a file that corresponds to your target Service. For example, if the UID is for an SSH Service running on your Pi, you could call this file SSH-Pi.txt.

Edit the following entries to match your account and target device.

  • user_id - your remote.it account user name

  • auth_hash - your remote.it account authhash How to get your authhash

  • remote_address - your target Service's UID How to get your UID

  • proxy_local_port - desired localhost port

Launching the P2P initiator


connectd -f SSH-Pi.txt &

The script will output connection information, then after about 10 seconds, you should see:

Starting Proxy on port 33000 on index 1.
Proxy started.

To get the process ID (PID) so that you can kill the connection when you are done, type:

echo $!

immediately following the connectd command.

Now you can connect to your target remote.it Service using and the port value you chose. The P2P connection will stay open until you terminate the process using "kill", or the internet connection drops.

Supposing that the value was 21456, then when you are done with the P2P connection, type:

kill 21456

Automatically maintain the P2P connection

You can set the autoconnect parameter value to 2 in the initiator provisioning file to have the daemon automatically attempt to reconnect to the target in the event of a network interruption.

Was this article helpful?
0 out of 0 found this helpful