In a single virtual machine project.
The IP address of the virtual machine isn't that important in a multi virtual machine project.
However, it's more likely that we want the two machines to communicate with one another directly.
In order to do this, we need to be aware of their IP addresses or we need to forward non conflicting
ports to the local host.
Instead, as we want to have our vagrant projects distributed to our team members.
And some of these team members may be within the same office, we need to pre define the IP address
so that any of our project code that needs to communicate with the other virtual machine can do so without
the other team members needing to change configurations.
We also need to ensure that the virtual machines are running on a private network only that are attached
to the machine of the user running it.
This will prevent the IP address conflicts within the network.
In order to do this, we simply use the networking options, which we learned earlier in the earlier
lessons, because we want the virtual machines to run in a private network.
It makes sense to use a range of private IP addresses which are different to your own network.
For example, my network range is 1922168.0, so I will use the range 190 2.168.1 for my virtual machine
network.
The IP address ranges are a subset of the range of addresses pre assigned for internal networks.
So the code will look like this.
We will type vagrant configure to in double quotes, which is version two do config and two sub configurations
for two servers which are three one and 232.
We'll use Veeam box, CentOS 7/7 and we'll add the following command for both servers as a re one or
a server two dot VM, dot network, private network and IP address for this server.
As I said, in my case, it's 192216381.3 and 1.4.
Now let's say this vagrant configuration file and start the environment by typing vagrant up.
I'll press pause here to wait until the environment is up and running and get back to you to test this
configuration.
So when the environment is up and running, let's test this out and test whether we can connect from
one machine to the other.
I'll connect to a server one by type in vagrant ssh SLV one and try ping in a server two from a server
one by typing pin as service two and the output is something like that that we are able to communicate
over the network from a server one to a server two as planned.