Directing commands like
rsync at a public IP address will automatically route the traffic over the public network. When using an IP address on the private network, the traffic stays on the private network and doesn’t count against bandwidth usage.
If you have two Droplets in the same datacenter with private networking enabled, you can transfer files between them over the private network:
Find the private IP address of the target Droplet. Click on the name of the Droplet to go to its detail page, then click Networking in its left navigation.
When the private network is enabled, the IP address is displayed in the Private network section:
If the private network is not enabled, you can enable private networking manually.
With file transfer tools like
scp, use the target Droplet’s private IP address to transfer files over the private network.
You can use password authentication or SSH keys to authenticate with the target Droplet. To use SSH keys, you need create an SSH keypair on source Droplet and upload the public key to the target Droplet’s authorized key file.
For example, with
rsync and the example private IP
rsync --verbose /path/to/file 198.51.100.0:/path/to/target/location
If you’re using password authentication, you’ll be prompted to enter your password for the target Droplet. If you’re using SSH keys with a passphrase, you’ll be prompted to enter the passphrase.
You can verify that the transfer was successful by connecting to the target Droplet and looking for the file in the target location.