Ubuntu Network Connection Files

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 »

Time
21 hours 25 minutes
Difficulty
Intermediate
CEU/CPE
21
Video Transcription
00:00
>> Hello Cybrarians, and welcome back to
00:00
the Linux plus course here at Cybrary.
00:00
I'm your instructor, Rob Gills.
00:00
In today's lesson, we're going to talk about
00:00
network connection files in Ubuntu.
00:00
Upon completion of today's lesson,
00:00
you're going to understand the net plan directory
00:00
and the configuration file there in.
00:00
We're also going to talk about network manager and how
00:00
network manager connections are configured,
00:00
the files that are used to configure those.
00:00
We're also going to learn about DH client,
00:00
but this time in Ubuntu.
00:00
Without further ado, let's go ahead and get
00:00
right to it with some demo time.
00:00
Into today's lesson, as I said,
00:00
we're going to take a look at Ubuntu.
00:00
Let's go ahead and open our terminal window here,
00:00
and we're going to navigate into
00:00
the directory that is called fc net plan.
00:00
Now, the fc net plan directory is going to contain our
00:00
configuration files that we would use
00:00
to set up the network configurations,
00:00
all the different interfaces on our system.
00:00
It's actually just a YAML file.
00:00
YAML is a file syntax that is
00:00
used by Ansible to do configuration.
00:00
We'll touch on Ansible much
00:00
later at the end of the course.
00:00
But for right now, let's just
00:00
go ahead and take a look at this file.
00:00
We're going to go ahead and do a less on this file.
00:00
We can see that this is just using network manager.
00:00
This isn't really super-helpful.
00:00
We'll take a look at network manager in a minute.
00:00
But generally, what you'd find in
00:00
this file would be this syntax.
00:00
You'd have a network line
00:00
and then you have things indented.
00:00
That's how YAML does things.
00:00
Then you would have individual lines to
00:00
configure things on the network.
00:00
For instance, you might have
00:00
an interface name [NOISE] for the system,
00:00
you might also have the DHCP4.
00:00
This should be set to yes or no,
00:00
yes for using DHCP,
00:00
no if we're using a static address.
00:00
If we were using a static address,
00:00
we would see a line that would say
00:00
addresses in this file.
00:00
Then finally, we would also see a line like
00:00
gateway 4 in this file that would
00:00
indicate the default gateway that'll be
00:00
used for static network on the system.
00:00
However, as I said,
00:00
we're not using net plan on this system.
00:00
No. We're using something called network manager.
00:00
Network manager has a different configuration location,
00:00
and you can go into fc
00:00
network manager system connections.
00:00
Now, if we do an LS in this directory,
00:00
we're going to see wire connection one nm connection.
00:00
Now, I can probably try and do
00:00
an LS and just hit "Enter" here
00:00
and what we're going to see is that we
00:00
have these weird backslashes.
00:00
The reason that we're doing this is because
00:00
next is escaping the space.
00:00
It doesn't really know what to do with it.
00:00
Unless it escapes it by putting
00:00
a backslash before every space,
00:00
it won't know how to interpret the file and
00:00
open it correctly. That's why you see that.
00:00
Another way we could do this,
00:00
and so they wouldn't see these weird backslash
00:00
is if we actually just copy this line,
00:00
including these single quotes,
00:00
and then we could do LS on it that way.
00:00
Actually in this case,
00:00
we can't even view it,
00:00
not like we could with that plan,
00:00
we actually need to get elevated privileges.
00:00
We're going to run pseudo edit
00:00
so that we can edit the file.
00:00
We're not actually going to edit it,
00:00
we're just going to view it,
00:00
but we use pseudo edit to get into it.
00:00
I'll type in my user password to
00:00
elevate my privileges and then hit "Enter".
00:00
Now we can see the contents of this file.
00:00
Again, here this is not a lot of information,
00:00
just as we saw in the previous lesson with
00:00
the network scripts directory and the F config ENP0S3,
00:00
we see the same thing here.
00:00
We've got an ID. This is a wire connection,
00:00
is type Ethernet, and we also see the interface name,
00:00
and that's basically it.
00:00
The reason for this is that just like we saw in CentOS,
00:00
on Ubuntu we're just running DHCP.
00:00
We'll see some information in here,
00:00
but certainly not as much information as we would have
00:00
seen in this file if we were running static addressing,
00:00
you would see additional entry lines here that would
00:00
have a value or a key on
00:00
the left-hand side and a value on
00:00
the right-hand side separated by an equal sign.
00:00
For instance, you see address equals and
00:00
then the IP address or
00:00
gateway equals and then the gateway,
00:00
so on and so forth.
00:00
But that's pretty much what we need to know
00:00
for the connection files inside of here.
00:00
Let's quit out of that file with escape, colon, quit.
00:00
What we're going to do now is we're going to take
00:00
a look at the DH client directory.
00:00
If we go into FCDHCP,
00:00
DH client, and what we're going to want to do this,
00:00
let's just do an LS less directory.
00:00
What we can see in
00:00
this directory is all of these DH client files,
00:00
and that's because DHCP in Ubuntu is a lot
00:00
more complex than it is in CentOS.
00:00
In fact, let's do another pseudo edit just in
00:00
case we have to get elevated privileges as well.
00:00
Let's take a look at the DH Client.com file.
00:00
Now what we can see in this file is that by comparison,
00:00
the CentOS is very complicated, very busy.
00:00
Remember in CentOS there's
00:00
only one line in this whole file,
00:00
send DHCP client identifier equals hardware.
00:00
Whereas here we're setting the host name,
00:00
we're going to send the host name over to
00:00
the DHCP client to get the information.
00:00
But we're also going to ask for that to be specified
00:00
using the RFC 3442 classic static routes,
00:00
and we're going to request a whole bunch of
00:00
information back from the DHCP server.
00:00
You can see this on the request line.
00:00
This is all the information that we're trying to
00:00
get back from the DHCP server.
00:00
Just remember that a DH client.com file
00:00
in Ubuntu is significantly more complex.
00:00
It requests a significant amount of information
00:00
more for the DHCP server
00:00
than what you would see in the CentOS system.
00:00
But that brings us to the end of the lesson today.
00:00
In this lesson, we covered
00:00
network connection configuration in
00:00
Ubuntu with net plan and network manager,
00:00
and we also talked about
00:00
Ubuntu's configuration of DHCP
00:00
>> using the DH client file.
00:00
>> Thank you so much for being here and I
00:00
look forward to seeing you in the next lesson.
Up Next