- In this video I will tell you about
run time network configuration,
and how that works.
So first you need to understand
how nodes obtain an IP address.
On servers, IP address configuration is set statically,
using tools like NMCLI or NMTUI.
On workstations, IP address configuration
typically is handed out to a DHCP server.
DHCP is Dynamic Host Configuration Protocol.
That is a server that has been created by
the owner of the network to make sure that
if you connect to a network, you get an IP address.
Which is the ID that you need in order
to communicate on the local network.
If you wanna do troubleshooting,
the IP command is used to set,
and check runtime network configuration.
When I'm talking about runtime network configuration,
what I mean is network configuration
that is not persistent.
In order to work with runtime network configuration,
you need to know which tool you should use.
Many people would say If config.
Well I can tell you IF config is obsolete.
It uses outdated methods for addressing
and displaying networking, and for that reason
doesn't display accurate information anymore.
You should not use IF config,
and on many distributions you won't
even find IF config anymore.
That's how it's supposed to be,
because in the late 1990's,
yes that's more than 20 years ago,
the Linux network stack has changed significantly,
and in order to deal with these significant
changes, net tools was needed.
And for that reason, IF config is obsolete right now.
An IP is the main command for managing networking.
Now here we have a demo,
and in this demo I have listed
the commands that you should know
in order to troubleshoot and analyze
your network configuration.
Let me just demonstrate.
So to start with I'm going to use
sudo IP A.
IP A in fact is short for
IP ADDR show,
but why would you want to type
IP ADDR show if you can also type IP A.
Look IP A is giving us the same.
As you can see, we have ENS 33.
ENS 33 is a network interface that I am using.
Now if you want to add IP addresses in runtime,
you use IP ADDR add DEV,
followed by ENS 33 in this guys.
And then you specify the IP address
including the subnet mass that you want to use.
Uh oh. Operation not permitted.
Is that so? Of course because we need sudo superpowers
in order to do something like this.
Now if you want to verify that this was successful,
sudo IP A, and that will show you
the secondary IP address has been added.
Hey how about IF config?
I told you that's obsolete, I know.
But I also know that some people
are kind of attached to it.
The problem with IF config is that
IF config has never been reworked
to address the IP stack in the right way.
So if you use sudo IF config,
you don't see the IP address that I just signed.
It's here, but IF config just cannot show it.
And in case you really don't believe,
lets do a man IF config and there we go.
This program is obsolete.
Use IP ADDR,
IP link instead.
That's all about IF config.
One more thing.
IF config is obsolete on Linux, on all Linux distributions.
If you are using Mac IOS, you might confuse
Mac IOS for Linux. It is not.
Mac IOS is a BXD Unix distribution.
And on that operating system different rules apply.
And one of these rules is that on
Mac IOS IF config is still the default utility.
But this course is about Linux,
so IP it is.
Now if your link is down then its not functional anymore.
So probably direct the FURU sudo IP link,
set ENS 33 up again.
In some cases, this may help.
Especially if you change some configuration
that needs to be rewrote.
Next up is IP route show.
The thing is that in IP you have a routing table,
and in the routing table at least
you should have a default route.
An IP route show allows you to see this default route.
In case you do not have a default route
then you can use IP route at default via.
But you know what, I'm not going to do that.
Because that would only confuse my IP stack.
I have a default route.
It's working so there's no need to change it.