Creating private IPFS network which is works on external internet not only LAN

Hi everyone,

I am using the IPFS version of 0.8.0.

I am trying to create a private IPFS network but I need to make connections with other IPFS nodes that are not in the local internet connection too (LAN).

I have tried it before, I followed the exact same steps in this Deploy a private IPFS network in 5 steps | by Sander van Laar | Medium tutorial, but I can’t connect my nodes with each other and I can’t see any peers when I run the command ipfs swarm peers. I have 2 nodes, one of my node is AWS EC2 machine, the other node is running on my local computer.

Is that possible to make the connection with external nodes and how can I manage them with or without a command line (I know there is an IPFS API but can I use this API to create and destroy any private network?)