Next up,
we're going to be taking a look at analyzing the network bandwidth
that's available to a network interface card.
Being able to monitor the bandwidth that is currently being used and what
speeds that we can get up to is going to be really important for analyzing
bottlenecks that you might have on your network.
Now, of course,
we do also need to understand what type of device that we're connected into,
whether it's a switch,
the speed of that switch or whether it's an old‑fashioned hub that's
going to have far more collisions related to it.
But as we go through and take a look at what we can do from our command line,
we're able to go through and install and load using apps.
Of course, we'll be working on the Ubuntu system,
but we can install it through YUM on our Alma Linux system.
We can then go through and monitor a particular interface,
and we're able to see then the bandwidth that we're
currently getting on that interface.
So if we're seeing a relatively low bandwidth,
we might have a misconfigured interface card,
or we might be plugged into a slower networking infrastructure device.
When we go through and take a look at these tools,
we can get a better idea of the configuration of our network
interface card to see what type of speed is available,
how it's been configured,
and whether or not we're able to get the same speed in both
directions or whether it's full duplex or half duplex.
With this, of course, we can go out and take a look at it on our systems.
We can go through and check the bandwidth by checking the
speed of our network interface card and the current bandwidth
that we're getting through from it.
So here we are, our glorious command line,
and we're going to go through and investigate a little bit
about the bandwidth that's available to us both configured
and what we're actually getting.
Now to begin with though, we're going to have to add in an extra repository,
the EPEL repository, to our Alma Linux system,
so I can go through and do a sudo and yum install epel‑release.
Once we can spell this correctly, we should be good to go.
Add in the ‑y so it doesn't prompt us once it's found the package.
And we can see that installs really quickly.
It's just an extra repository file.
We're going to go ahead now and install nload.
Nload is going to measure the bandwidth throughput that we are getting,
and it's going to come from the EPEL repository that we've just added.
Again, we can go through and do something similar.
So yum install ‑y nload.
It's a very small package, so it comes down really nice and quickly.
Now with that installed, we're going to be able to use it,
but we can also use the standard tool.
Ethtool is installed as standard to actually look at our
configuration of our network card.
So if we look at enp0s3, when we take a look at this network card,
the important thing is the supported link mode,
so the speed that is supported on this system,
as well as then what we are currently configured for,
and that's shown within our speed and duplex.
So we are supporting Mb/s, or a gigabit per second,
in full duplex, so in both directions.
And that's the fastest possible configuration that is supported on this system.
So this is really good.
It looks like the configuration is correct,
but of course,
we want to check whether or not we're getting anywhere near that performance.
So if I go through then and use nload, the command that we've just installed,
and look at again at enp0s3,
we're able to see then our average incoming is about 1,000 bits per second.
And we can also go through and take a look at our outgoing,
and we can see then that our outgoing is averaging
probably just a little bit more.
When I take a look at that, it's about 1.6 Kb/s at the moment.
But we're relatively limited on what we're actually doing.
So we could try and download a file to give a
little bit more work to our system.
We've got to remember as well this is a virtual machine,
so there are other systems that are taking effect on
our performance that's available,
but it gives us an idea of some of the tools that we can use for checking.
So if we go through then and use a curl ‑L.
And taking a look, I'm just pasting in a URL here.
It's downloading an rpm file to install VirtualBox.
I'm not really worried about the download itself.
I'm using ‑o to store it in a test rpm.
We're not going to use the download,
but it's just giving us a larger file to work with.
When we go through and look at this,
we want to be able to background it so we can look at nload as well.
So I'm going to redirect both our standard output and our
error output through to dev and null,
and then the ampersand at the end allows me to run it in the background.
So of course,
we can up arrow key to get our nload command back
to monitor the enp0s3 interface.
And we're able to see now, again, we're getting similar sort of results.
So 1,000 bits per second averaging on the input.
And when we go through and take a look at the outgoing,
then again it's averaging about 1.5 Kb/s,
so 1,500 bits per second.
So by using each tool,
we're able to see the maximum performance that's
available from our network card, and then using nload,
we're able to see the current performance that we're able to get from
our network card and then correlate the two together to see what we can do to try and improve any situation.