What I try to achieve:
Multiple virtual machines (virtualbox) on a Debian host which communicate with another server (not with each other or the host). All VMs need to have the same static network settings (so that i can clone and use them without changing the settings in the guest). Every networking attempt of the VMs has to be redirected to the aforementioned server.
My current setup:
- I create a tap on the host for each VM and use bridged networking to connect the VMs with the corresponding tap
- All taps are connected with a bridge. The bridge has an ip address which is the gateway for the virtual machines.
- The host as a dedicated interface which connects it to the server. This interface is also connected with the bridge
- An iptables SNAT rule on this interface to connect the VMs with the server
- An iptables DNAT rule redirects all traffic from the bridge to the server
This works so far. But with this setup the VMs cannot have the same ip address because they are connected via the bridge. I tried to SNAT the ip addresses on the taps but that didn't work.