Setup: I have 4 Raspberry Pis at home interconnect via a switch (normal router) in my home network. Now I can access them on my pc and use SSH.
What do I want: I want to write a python script that automatically reconfigures the network topology of my little "cluster". Physically, they are all interconnected but I want to configure the nodes such that, let's say, they communicate in a ring topology where 1 -> 2 -> 3 -> 4 -> 1. Other topologies are also possible.
Purpose: I can then easily reconfigure the network topology and then test distributed applications on the cluster and see how they behave.
Question: To start, I would like to know which config files I have to touch in Linux to reconfigure the network topology? I know Linux but I am not an expert so I would be very happy to collect some tipps. A good idea would be to manually configure it by hand at first, and then later I can use my script. My idea is, as an example, to add routing table entries on each node of the cluster, such that node x forwards an incoming packet, depending on its source and destination node, to the next hop. With all the new routing/forwarding, I can then establish a new network topology. E.g., in a ring topology, node 1 has to forward its packet to node 2 if it wants to send it to node 3. So there is one extra node/hop inbetween.