Federation mechanisms

As part of some research for an university course, I’m trying to understand how Mastodon federation works exactly, by setting up an isolated environment and replicating a federation of instances.

So far, I have tried running some Vagrant machines, with the docker setup, and a domain hardcoded in /etc/hosts. However, I haven’t been able to make them find each other. Can anyone give some directions on this?

Thank you!

DId you try to follow one user of instance A when using account on instance B?

Yes, but instance A wasn’t able to find instance B, although they shared a network interface and running ping from each of them to each other did work. So I thought that maybe there is some more configuration that is necessary and I don’t know about.

What does it mind wasn’t able to find instance B?

Did you try “remote follow” button? If yes, what exactly happens?