Network Connection Configuration (Demo)

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 Goelz,
00:00
and in today's lesson we're going to be discussing
00:00
network connection configuration using
00:00
some commands to do so in Linux.
00:00
After today's lesson, you'll be
00:00
able to use the ip command,
00:00
we're going to learn about the ping command,
00:00
we're going to leverage ethtool
00:00
to change network card settings,
00:00
and we'll learn how we can use
00:00
iwconfig to modify wireless network settings.
00:00
Let's get going with some demo time.
00:00
For today's demo, we're going to go ahead and get
00:00
started over here in CentOS.
00:00
What we're going to look at first is the ip command.
00:00
Now if you've come from earlier versions of
00:00
Linux or if you're
00:00
a long-time Linux system administrator,
00:00
you're probably familiar with the ifconfig command.
00:00
The ifconfig command is becoming deprecated.
00:00
Nowadays most people use ip and we can do
00:00
a ip addr show
00:00
to show an IP address just like we would with ifconfig.
00:00
What we'll see here is that we only
00:00
have one real IP address,
00:00
192.168.1.14, and that is on the interface enp0s3.
00:00
Now if we wanted to change that IP address,
00:00
we could do that with ip addr add and give it a new IP.
00:00
For instance, we could say 192.168.1.15 and we can
00:00
say dev and then we could say the device, enp0s3.
00:00
If we hit "Enter" here,
00:00
we would be able to change this IP address.
00:00
Realistically, we probably need to be
00:00
pseudo in order to do that,
00:00
but that would allow us to change the IP address.
00:00
However, this would only allow us to
00:00
change the IP address temporarily.
00:00
Remember, in order to actually
00:00
make changes to the IP address on
00:00
a system in a CentOS Linux system
00:00
and have them be persistent,
00:00
you need to modify the interface file that's found in
00:00
etc sysconfig network scripts and
00:00
our system here would be enp0s3,
00:00
and then we would be able to go into this file and
00:00
change this actual setting and set an IP address.
00:00
But let's take a look at
00:00
some other things we can do with the ip command.
00:00
We can also do an ip link set on enp0s3.
00:00
Just going to grab that, copy it,
00:00
enp0s3 down, and we're
00:00
going to do this with elevated privileges.
00:00
What we can do is actually show
00:00
that this interface is down,
00:00
[NOISE] and we can see that that link is no longer up.
00:00
It shows the state is down.
00:00
Now if we wanted to set this link back up,
00:00
we would just change this last part of the line to say,
00:00
"pseudo ip link set enp0s3 up."
00:00
Now if we do another ip link show,
00:00
we can see that the system is up,
00:00
that the enp0s3 interface is back up here,
00:00
and after a little while is going to grab
00:00
another IP address as well.
00:00
That's pretty much what we need to know
00:00
for the ip command in CentOS.
00:00
Now let's take a look at the ping command.
00:00
I'm going to go ahead and hit
00:00
"Control L" on my keyboard to clear the screen.
00:00
What we are going to do here
00:00
is just take a look at the ping command.
00:00
This is probably familiar to everyone.
00:00
You generally do this to make sure
00:00
that your system can communicate to
00:00
the outside world or that
00:00
you communicate between systems.
00:00
We're just going to ping www.google.com.
00:00
But now what you're going to notice pretty quickly here
00:00
is that if you've come from a Windows environment,
00:00
this ping command just never times out.
00:00
That's because if you're using
00:00
a Linux system and you're running a ping command,
00:00
it doesn't operate the same way as it does in Windows.
00:00
You actually have to specify a count.
00:00
The way that you do that is by using the dash c option.
00:00
This is going to be similar to what you would see
00:00
in a Windows environment if you just
00:00
give it the count of four.
00:00
We'll run this again and what it'll do is
00:00
it will run four pings.
00:00
These are ICMP echo request packets
00:00
that are being sent to www.google.com.
00:00
After it runs four times,
00:00
it's going to give us a summary
00:00
information about the packets,
00:00
how they went, what the loss was,
00:00
and the latency, the time in milliseconds.
00:00
We see that everything was going
00:00
through properly, so that's great.
00:00
This is pretty much all that you
00:00
really need to know about the ping command.
00:00
If you want to know more about the ping command in Linux,
00:00
do a man ping,
00:00
and this will give you all of the options that
00:00
you can see for ping in Linux.
00:00
Let's move over and take a look at our ethtool command.
00:00
Again, I'm going to hit "Control L" to clear my screen.
00:00
Let's do ip link show again.
00:00
[NOISE] We see that our interface is enp0s3.
00:00
What we could do is we can do ethtool on this enp0s3.
00:00
What we see here is all of the supported link modes.
00:00
We see information about the speed of the connection,
00:00
the duplex, whether or not it's
00:00
set to receive auto-negotiation.
00:00
In other words, configured speed
00:00
duplex by negotiating with
00:00
the thing that it's connected to,
00:00
whether it's a switch or a hub or what have you.
00:00
What we would do here if we needed to change this,
00:00
is we would use the ethtool
00:00
and then specify the interface again,
00:00
it's enp0s3, and we can say we
00:00
wanted to change the speed,
00:00
>> and then we'd give the value.
00:00
>> We could change the duplex [NOISE] and give it a value.
00:00
But before we do either of those things,
00:00
what we would need to do is set
00:00
auto-negotiate to off instead of on.
00:00
By setting that to off,
00:00
then you can manually set
00:00
those configuration changes and make
00:00
those configuration changes to the interface.
00:00
Now we're going to go ahead and move over to
00:00
Ubuntu for this next command.
00:00
We're over here in Ubuntu
00:00
now and why we're over here is because
00:00
the iwconfig command is specific to Ubuntu.
00:00
There's something similar to it in CentOS,
00:00
it's just call iw there instead of iwconfig,
00:00
but since the Linux Plus exam objectives
00:00
specifically call out iwconfig,
00:00
let's take a look at it here.
00:00
We don't actually have a wireless network.
00:00
The iwconfig command is used to display
00:00
wireless network configuration information
00:00
and used to configure it.
00:00
You can configure device as an access point or you can
00:00
configure it as a client trying
00:00
to connect to an access point.
00:00
I don't really have anything to configure here,
00:00
so what I would just show you real
00:00
quickly is the man page,
00:00
the manual for iwconfig.
00:00
Inside of here, you can see
00:00
all of the changes that you can make.
00:00
You can set the SSID,
00:00
you can set the mode that it's using,
00:00
you can set the frequency and
00:00
channel the wireless is using.
00:00
A lot of settings in here that you could do.
00:00
Really, for the exam,
00:00
you just need to know that
00:00
the concept that iwconfig is used to
00:00
configure a wireless setting on a Linux system.
00:00
With that, we've come to the end of this lesson.
00:00
In this lesson we covered the ip command,
00:00
ping, ethtool,
00:00
and the iwconfig command.
00:00
Thank you for being here and I look
00:00
forward to seeing you in the next lesson.
Up Next