WEBVTT

00:06.410 --> 00:08.990
In a single virtual machine project.

00:08.990 --> 00:16.420
The IP address of the virtual machine isn't that important in a multi virtual machine project.

00:16.430 --> 00:24.650
However, it's more likely that we want the two machines to communicate with one another directly.

00:24.680 --> 00:33.290
In order to do this, we need to be aware of their IP addresses or we need to forward non conflicting

00:33.290 --> 00:35.870
ports to the local host.

00:35.870 --> 00:43.580
Instead, as we want to have our vagrant projects distributed to our team members.

00:43.580 --> 00:52.190
And some of these team members may be within the same office, we need to pre define the IP address

00:52.190 --> 01:03.530
so that any of our project code that needs to communicate with the other virtual machine can do so without

01:03.530 --> 01:07.520
the other team members needing to change configurations.

01:07.520 --> 01:16.220
We also need to ensure that the virtual machines are running on a private network only that are attached

01:16.220 --> 01:19.520
to the machine of the user running it.

01:19.520 --> 01:24.440
This will prevent the IP address conflicts within the network.

01:24.710 --> 01:32.600
In order to do this, we simply use the networking options, which we learned earlier in the earlier

01:32.630 --> 01:37.900
lessons, because we want the virtual machines to run in a private network.

01:37.910 --> 01:45.230
It makes sense to use a range of private IP addresses which are different to your own network.

01:45.230 --> 02:00.170
For example, my network range is 1922168.0, so I will use the range 190 2.168.1 for my virtual machine

02:00.170 --> 02:00.890
network.

02:00.890 --> 02:08.990
The IP address ranges are a subset of the range of addresses pre assigned for internal networks.

02:08.990 --> 02:12.260
So the code will look like this.

02:12.260 --> 02:21.830
We will type vagrant configure to in double quotes, which is version two do config and two sub configurations

02:21.830 --> 02:26.930
for two servers which are three one and 232.

02:26.930 --> 02:37.640
We'll use Veeam box, CentOS 7/7 and we'll add the following command for both servers as a re one or

02:37.640 --> 02:45.560
a server two dot VM, dot network, private network and IP address for this server.

02:45.560 --> 02:53.160
As I said, in my case, it's 192216381.3 and 1.4.

02:53.180 --> 03:01.250
Now let's say this vagrant configuration file and start the environment by typing vagrant up.

03:01.250 --> 03:09.260
I'll press pause here to wait until the environment is up and running and get back to you to test this

03:09.260 --> 03:10.400
configuration.

03:10.400 --> 03:17.720
So when the environment is up and running, let's test this out and test whether we can connect from

03:17.720 --> 03:19.810
one machine to the other.

03:19.820 --> 03:30.050
I'll connect to a server one by type in vagrant ssh SLV one and try ping in a server two from a server

03:30.080 --> 03:39.320
one by typing pin as service two and the output is something like that that we are able to communicate

03:39.320 --> 03:44.120
over the network from a server one to a server two as planned.
