Creating Forward Ports
Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or
Already have an account? Sign In »

Video Transcription
00:00
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 port fording in our vacant machine. So let's get started.
00:15
The learning objectives for this video are we will learn how to create a network in vagrant using Port 40.
00:23
So let's start our demo.
00:26
Okay? We are in the vagrant foul. Remember, The vagrant file is the most important file A vagrant because it instructs vagrant the configuration of our machine are vagrant machine.
00:40
So as you can see, most of the text is in green, which means it is common it out.
00:48
So looking at lines 22 to 26 we see
00:54
information about port fording as well as on lines 28 through 31.
01:03
We also Seymour information about poor fording. So you may be wondering what's the difference between the two? Well, lives 20 to 26 is port forwarding for any I p.
01:19
So here
01:23
we're specifying port fording our guests which is our vagrant machine in our host which is our host machine and on lines 28 through 31.
01:38
It's the same thing except where limiting r i p to local host.
01:44
And essentially, what this will do is it would disable public access. So remember, and our lecture where I discussed port fording, I mentioned that when you create port, fording that all of the interfaces are bound
02:01
to your port forwarding, meaning any device that is connected to your network
02:07
has access to report fording. So if you want to be more strict or more of restrictive, you will probably probably want to use lines 28 to 31 where you're specifying the port, Ford and toe only happen on your local host and make it more restrictive.
02:25
And honestly, that's what we're going to use for this example.
02:30
So I'm going to comment out this uncommon out this line, and I am going to keep guests as 80. But I'm going to change the host from 80 82 1234 So that way we can make sure and see that
02:50
you know, it's ah, host that we have to find,
02:53
and I'm going to say the vagrant file and I'm going to go back to Commander. We're going to enter the command vagrant up,
03:17
and as you can see we have a new four port of 80 to 1234 And that's what we modified inside the vagrant file.
03:44
Okay, great.
03:45
Our vagrant machine is ready. So now we're going to answer http 1 27.0 dot 0.11234
03:58
And our forward port worked. And the reason how we know our Ford Port work is because the website has rendered our boom boom to Apache. Http. Default page.
04:13
So remember, in less than four where I discussed secure show and
04:18
we also installed our Apache. Http server and I show that once you installed this server, there's a default page to let you know that the installation was successful. So this is the page.
04:35
So I know that our port fording is successful because, as I mentioned,
04:42
my host machine is a window 64 machine and I do not have Apache installed on my machine. Apache is only installed on my vagrant machine, which is unbuttoning machine on boot to trustee 64. So I know my port forging works
05:00
from
05:01
poured 80 on my vagrant machine. The traffic is being rerouted to pour 1234 on my host machine on the local host. So I know that my port fording works.
05:15
So to recap first we opened the vaguer foul it remember The vacant file is the most important violin vagrant because it specifies the configuration of your vagrant machine. There are two types two blocks of port forwarding and vagrant. The first, the first block
05:35
specifies port fording
05:39
that allows public access. We did not want to do this because we didn't want our Port Ford and to be open to the world. That's essentially what this block would do.
05:50
Instead, we use Block
05:53
28 to 31 here where we were more restrictive and we only wanted our public. We excuse me, we only wanted our port foraging for the local host 1 27.0 dot 0.1. And that
06:10
disables public access and allows us to b'more restrictive
06:15
with our port 40. So we ian commented outlines 31 we changed the host I p from 80 82 1234
06:27
port that we picked that we would know that Okay, the vagrant foul picked up our configuration because we specified the port for our host.
06:38
Next we went to commander and we started our vagrant machine.
06:44
Then we went to our host machine and we typed in the I p address of 1 27.0 dot 0.1 port 1234 which we specified in the vagrant foul and
06:59
our port forwarding work. Because our own boo to Apache. Http Server
07:05
Defar page rendered. And as I said before, I do not have first I'm not using on Abou to machine on my host machine. I'm using windows. Second of all, I don't have Apache installed on my host machine. Apache is only installed on my vagrant machine,
07:24
which isn't a boon to machine Mobutu Trustee 64. So I know that our port forwarding
07:30
worked. So now let's go back to our lesson So and summary in this video we learned how to create a network in vagrant using port fording. In our next video, we will have a demo on how to create a public network and vagrant
07:46
So I can't wait to see you in that video. Have a good day
07:50
by
Up Next
Similar Content