In this video we'll talk about some common network utilities.
There is Ping, which you can use to verify host reachability.
SS allows you to show information about local ports that are open.
Dig is for DNS testing.
NMAP is a powerful utility that can be used for network analysis.
Netstat is an old utility which has now been replaced with SS. And NSLookUp is also
an old utility nowadays. Use Dig instead. Let me show you what these tools are doing.
So the ultimate utility to verify functionality is Ping.
I like to use ping on google.com because if that is
reachable, it means that everything in my network stack is running.
You can also use Ping a couple of times. If you use ping
C4, it will only send out four packets, otherwise it will continue forever.
Now, in the packet information you can see who has answered from which IP address the answer came.
And you also see a sequence number. And most important is the round trip time.
75.5 milliseconds. That's an indicator of how fast it was.
So this is going on the Internet now I'm curious what is going to happen
if I use ping on 192-16-882 9.2. There you can also see the round trip
time. And as this is local network, you can see it's significantly faster.
That's to be expected because it's local network. And hey, I like that.
Let's also try it on Ubuntu.
Ping C4 on Ubuntu is not doing anything. Why not? Because I'm
in my SSH session on Ubuntu. So let's do it right here.
Ping C4 to Ubuntu.
It's showing the round trip time still pretty decent between these virtual machines.
Next thing that you might want to check is SS
minus Tuln, which is showing currently listening network connections. So
these are the network ports, they relate to services.
And most important is what we see here. This is your SSH.
So SSH is listening on all IPv4 but also on all IPv6.
Now what you might not like about this service information is
that it's not really easy to understand what it is.
So add picture to it if you want to get.
No, let's not do that.
So remove the N option. So SS tul where you can see that the
ports of the services are replaced by service names. These service names, by the
way, are according to the contents of the etc Services file. That is a
standardized file which is showing you which service is assigned to which specific port.
An alternative deprecated way of doing it, but people still use it. So let me show it anyway.
Is sudo netstat.
It's giving more or less the same information, but it's a deprecated utility so you shouldn't be using it anymore.
Then there is dig. If I use dig nu nl then I'm getting information
about the nu NL from DNS. So it has received an answer and the
answer session is like this, where we can find the IP addresses behind it.
Now that I'm talking about it, let me do a sudo DNF install traceroute that was not on
the slide, but now that we're talking about cool utilities, I want to do a traceroute as well.
So traceroute to nu nl.
It's doing what? Well, it's showing all the servers on the
Internet between me and my destination, all the so called hops.
So here I can see my local gateway all the way up to 16 hops. Further, the
server that I'm reaching out to that makes sense because I'm currently in California and the server
is in San Francisco, so there's half a planet between them. Final utility that I want to
show you is nmap. I'm using sudo dnf install y NMAP to install it.
And then we have the NMAP utility.
Now one thing, one warning.
NMAP by some is considered a hostile utility, so only use it on your own servers.
It requires sudo privileges. So I'm using sudo nmap sn on
1921682 sn is for scan network. It will find all the
IP addresses that are in an active state on my current
network and there I can find my Ubuntu host.
So if I want to know what's going on on the Ubuntu, then I'm using sudo NMAP to the
Ubuntu host and that is showing a list of all ports that are listening on the Ubuntu host.
NMAP has many more advanced utilities, but that is really getting
in an area where most people don't need to go.
But here, NMAP on a specific host is giving you a convenient list of
ports that are listening on that host and that can be really helpful.