So let me tell you something important.
The information in this lesson should not be used on the exam.
Why is that?
Well, that's because I'm going to tell you about NMCLI.
It's an awesome utility that has awesome tab completion,
but it's too complicated.
And we have a much easier utility
that can be used as well.
But hey, I want to give you some information as well,
because in your daily work, using NMCLI can be convenient.
So NMCLI is a network manager command line interface.
NMCLI con show will show you current network connections.
And NMCLI dev status is showing current network devices.
And you can do beautiful commands like this.
NMCLI con add, con name.
So you want to add a new connection.
And this new connection should have the name my new connection
or whatever you want.
I have name is the name of your network device.
IPv4.address is the IP address.
And IPv4.gateway is the gateway.
And IPv4.method must be set to manual.
And the type is ethernet.
And that will be doing it.
I hope you understand why I don't
want you to do this on the exam.
The command is too long.
It's so easy to make errors if you are going to do it.
But you can.
And if you do it, you can use commands like NMCLI con up
my new connection to activate the new connection.
Before I continue, let me show you.
All right, let me use NMCLI tab tab.
That's for the tab completion.
I was telling you NMCLI has awesome tab completion
at all levels.
You can use it.
So con is making it connection.
Tab tab is showing all the different options
for my connections.
And what I need here is con show.
And there I can see the name of my connection,
ENS160, with the UUID that is too long to pronounce,
which is currently connected to the device ENS160.
Then NMCLI dev status is showing my devices.
So we can see the device and the connected connection.
Now I'm going to do the magical thing.
NMCLI con connection, add.
And after add, we do what?
Oh my goodness, display all the 132 possibilities.
This is where it's going to be complicated.
So here are all your possibilities.
Do you understand why I don't want you to do this
on the exam?
But even I want to show you anyway.
I'm going to use con name.
My new connection, why not?
Then what do we need?
Well, tab completion is giving you, again,
all the 131 possibilities.
So probably that's so much that it's getting kind of useless.
So I'm using IF name.
And now tab completion is convenient
because I can see that my IF name is ENS160.
And then I know that I need IPv4.
And there tab completion is kind of convenient as well.
You can see all the different options.
So I'm going for the addresses.
And I'm giving it 10.0.0.10 slash 24.
And also IPv4.g for gateway, 10.0.0.1.
And we do need to add IPv4.methods, manual.
And finally, type ethernet.
And wow, that fills my entire command line.
And now let me show you.
And we can see that the connection was successfully
added.
So if I would use nmcli-con show,
then I can see that my new connection is here.
But it is not connected to a device.
So what do I need to do if I want to connect it?
Well, I need nmcli-con up.
I'm not going to do that because I don't really
want to use this connection here.
This was just for demonstration purposes
of all the awesome things that you can do with nmcli.
But hey, let's wait.
There's more.
So some more nmcli commands that I want to show you.
We have seen nmcli-con show, followed
by the name of your connection.
That will show you all the connection settings.
And nmcli-con mod allows you to modify connection settings,
just like we have just done it in nmcli-con add.
And nmcli-con reload allows you to reload
the modified connection.
Then there is this option IPv4 method.
You need to use IPv4 method manual on connections
that don't use DHCP.
And without this setting, a DHCP server
will be contacted anyway, even if static configuration
has been set.
But above all, use it for the best in real life.
Don't use it on the exam because really you
would lose so much time.
And why would you if there is also nmcli?
You'll learn about it in the next video.