Hello. My name is Jasmine Jackson and our courses intro to vagrant. And in this video I will show you a demo on how to create a public network and vagrant. So let's go. The learning objectives objectives for this video are we will learn how to create a public network in vagrant.
So let's start with the demo.
Okay, We have our vagrant file open. And remember, the vagrant file is the most important file in vagrant as it specifies the configuration for your vagrant machine and looking at lines 37 to 40
it specifies how to create a public network.
So what we're going to do is we're going toe uncommon outline 40 and we're not going Teoh, change this line. We're just going to keep it as it is now Remember, for public networks, you can specify the i p
using d HDP dynamic host configuration protocol
where your I P is automatically assigned or we can use aesthetic I p where we can specify an I. P. Well, how Line 40 is configured. We're going to use d HCP dynamic host configuration protocol,
but the line is using d HCP implicitly as we don't have to explicitly
specify it online. 40 The syntax here is automatically telling vagrant we're going to use the D http protocol because we did not specify a static i p.
So let's go back to Commander
let's into the command vagrant
to start our vagrant machine which is our boot to trustee 64 machine.
And as you can see here for network interfaces now we have abridged
network interface which specifies that we have a public network
and you also notice In our last lecture we talked about four reports where we had a line 80 for guests that went to 1234 on the host. You don't see that line anymore because we re commented out that line So it's not showing up in our configuration.
Four vagrant for vagrant machine.
So now I'm going. Teoh answer Vagrant
To create a secure show to our vagrant machine are Mobutu trustee 64 machine.
Now I'm going to enter the command. I have config
for Lennox. If you're working with windows, it will be i p config
And now we have each one and we have
this I p address of 19 to 1681 83 1 83 Excuse me. I'm thinking of the http port of 80. So repeating the
i p addresses 192.168 dot one die 83. So we're going to
and we're going to go back to our host machine
and we're gonna answer http,
Oh, I forgot to copy the one
and press answer, and and our public network
was configured properly. And the reason I know this is because, just like with our port fording
our own boot to Apache, http, default page is rendering. And as I said in the port, fording that I'm going to repeat here. My host machine is a window 64 machine, and I do not have Apache installed
on my host machine. I only have Apache installed
on my vagrant machine, which is unbuttoning machine trustee 64. So I know that our public network was successful because I'm able to see this default page. So to recap,
we ian commented out the line Life 44 Public network. And as I said before, with public networks, you can either configure it using D HCP Dynamic host configuration protocol
where the I P is automatically assigned or you can assign the i p with a static I p
Well, we use d eight c p and it might not Look,
you might not be able Teoh readily see that online 40. But since we didn't specify i p address for a static I p address, vagrant knows that implicitly were using d eight c p.
So next What we did was we saved our vagrant file. We went back to Commander
and we started our vagrant machine. And as I said before looking at the network interface, we see that we had a second adapter which was bridged, which was a tell tale sign for us that we were using a public network.
Then, after our machine Buddhist successfully, we created a secure show into our vagrant machine. And then we enter the I F. CONFIG command to get our I p address. And from there
the reason I used the Ethan one is because I p addresses that start with 192.168
are usually public networks. They're usually internal
public networks. So I knew that this i p was most likely the I p that was generated from our Vacher file. From there, I went to my host machine and type in http.
192 down 168 That one. That 83.
And I was able to get our own boot to Apache. Http Server Defar page to render. And I knew that our public network was configured properly as I'm going to repeat again. I don't have Apache installed on my host machine, and my host machine is a window 64 machine.
So I knew that our public network was configured properly.
Now let's go back to our lecture. So in summary in this video, we learn how to create a public network in vagrant. And as I said before, the really good thing about vagrant is that the commands are pretty intuitive and it really doesn't take a lot to configure
a vagrant machine. So in our next lecture, I will provide a demo of how to create a private network. So I can't wait to see you in that video. Have a good day. Bye.