 Hey guys right now we are going to talk about networking and networking is handled by a service called Network Manager and it's quite a cool service And you can interface with it by using the graphical user interface or more commonly it's command line client Which is called nmcli now network manager manages your connections using profiles To show the profiles that we have we can make use of the command nmcli con show now Something that I really like about using nmcli is that you can tab complete the heck out of it So if you don't know how to use it, you can simply say nmcli and then I don't know what comes after that So I'm just gonna hit tab twice and it says well these are the sub commands now I gave you a bit of a clue we can make use of the command nmcli con show Con is in the abbreviated form for connection. So let's go and find out what connections we have something to say See yo tab Okay, what comes next? I don't know. It's gonna hit tab again And you can see right now that we have a number of sub commands that are applicable to to connection So we're gonna do a connection show and like I said network manager makes use of profiles We have a profile right now called wired connection one our profiles have got a uu id associated with them Just be just in case someone has created a profile with the name that is really in use So the uu id will ensure that it's even more so unique because the uu id will uu id stands for universally unique identifier and what you can see over here is that this is an ethernet based Profile and it uses a device that is present in my system called EMP one s zero So generally when you have a device file a networking device file that begins with en That is an ethernet based network adapter So what we're gonna do right now is that we want to reveal the properties even more so detailed properties of that particular profile So how we do that is by saying NMCLI connection show and then the name of the profile if it has spaces you can tab completed It would put a backslash in front of every every space or what he could do is that you can encapsulate it either using single or double quotes So what are you looking at right now is the output of NMCLI con show Against a profile and you could see that we have a number of attributes and property combinations on the left-hand side over on the right-hand side you could see the then the values associated with those With those property and attribute combinations. So things like the connection ID Wide connection one, so I'm gonna scroll a little bit further down. I'm gonna use the spacebar to page down You could see that we have the IPv4 method which is set to manual So we're configuring TCP IP in this particular case and using a static configuration We have IPv4 DNS You can see the DNS server the DNS search order that we are making use of and then at the bottom of a year We have the IP addresses themselves Along with the gateways that we are making use of So what I'm gonna do right now is that I'm gonna add a brand new connection profile And we're gonna add a brand new connection profile for the network interface that we have Another way to display the network interfaces would be to make use of the command NMCLI And we could say dev for device and again type in DE hit tab twice and you could see that it would Automatically complete to device what comes after that don't know hit tab twice And we want to show the devices that we have so we're gonna say NMCLI device show so right at the top of a year We have a device EMP 1 s0 that we are gonna be using right now So the command of a year guys I'm gonna say NMCLI con and we're gonna add a brand new connection profile so con add So what comes afterwards don't know hit tab twice. Let's go and find out So we could go and say a number of these things like right now like the connection name So we're gonna say con name. We're gonna give the connection name static Connection And now we're gonna go along and specify some additional properties So guys, I'm gonna quickly clear my screen and just to show you that we can continue to tab complete this I'm sending a tab twice and you can see all the other properties So at the very least what I need to do is specify things like the the connection type This is an ethernet base connection. Now if you didn't know that you could say type and then hit tab twice And you can see the different options over here. So this is gonna be an ethernet base connection Okay, what else I'm gonna tell it to use an interface And I'm gonna say if name and the interface that we are gonna use is EMP 1 s0 Now this stage I could go and specify some additional properties But I'm not gonna do that. I'm just gonna hit enter right now So what do you can see is that I do indeed have a new connection that has been added It's called static connection. That is the profile and just looking at the output of nmcl icon show You can see that one is sort of colorized in green The other one is not the one that is colorized in green is the currently Activated profile and if you only wanted to display active profiles, you could say dash dash active like that Now I've got two profiles. They are both wanting to make use of the same device and well that wouldn't be possible Right, I mean two profiles using the same device. So only one profile can be activated at a time In this particular case and the one that is activated right now is wired connection one If you needed to do something like change the properties of a profile, what you could do is say nmcl icon Mod to modify the properties. So what we are gonna modify right now would be a static connection Now what about static connection are we gonna modify hit tab twice and it says well, they are 229 possibilities. Do you want to start display them all and that's probably a bad idea? So at the very least guys what I'm gonna do is change properties like how about an IP address? So I'm going to say nmcl icon mod. We're gonna modify a property IPv4 and an attribute called Addresses and the value that I'm gonna give it is 10.0.0.1 with a 24-bit subnet mask So let's go ahead and throw over there. So that property change has been has been influenced right now Let's go to add a gateway. So the command is nmcl icon mod and we're gonna do it for static connection IPv4 dot gateway and now we're gonna set the gateway to be 10.0.0.254 And if I wanted to go along and set up a DNS server I could do so easily by saying nmcl icon mod and then the name of the profile then the attributes and property combination So in this case, it's IPv4 dot DNS and I'm gonna use my gate where's my DNS server done that easy So let's go show the results of that So the command right now is gonna be nmcl icon show and then the name of the profile and I'm just gonna call out some of the changes that we had made So first of all, this is making use of an interface called EMP1S0 It is set to automatically be initialized whenever network manager starts up. Let's go and page down the IPv4 method of a year set to Auto we're gonna change that very shortly to manual. You can see the DNS server that we are making use of is 10.0.0.254 Scrolling a little bit further down. You can see that we have IPv4 addresses That's the IP address that we had set along with the gateway right now So one thing that we haven't done is activate to this profile So if you have a look at again at the output of nmcl icon show You'll see that static connection is not the active profile now I could easily go and do that right now I could go and bring it up by saying nmcl icon up and then the name of the profile. However That would disconnect me from the server because I am SSH'd into server-a So instead what I'm gonna do is that I'm gonna show you How that command would work against a profile that is currently running So what I'm not gonna do is use nmcl icon and we're gonna delete a profile So again tab completed and we're gonna delete static profile or the static connection And what I'm gonna do instead right now is that the IP address that I'd previously allocated That I'd set to be used for that profile. I'm gonna give it to the current Profile so right now I'm gonna say nmcl icon mod. We're gonna modify Wide connection one what we are gonna modify about it is IPv4 dot addresses and we're gonna set the additional IP address To 10 dot 0 dot 0.1 with the 24-bit subnet mask now should I hit enter at this stage? I'm gonna be overwriting the current IP address So instead of what I'm gonna do to add an IP address I'm gonna say plus and then the property and attribute combination along with the with the value and There we go So now if you have a look at the output of nmcl icon show Against wide connection. You'll see that there are two values for an IP address You can see over here that IPv4 addresses and you can see we have a comma separated list of a year And we have two addresses right now one seven two twenty five two fifty ten and ten zero zero one both with 24-bit subnet masks So let's go and do that one more time for IPv4 DNS We want to set multiple DNS servers. So look at the DNS server that is currently set. It's one seven two twenty five 250 dot two five four So what I'm not gonna do is say nmcl icon mod We're gonna modify wide connection one and we're gonna change IPv4 dot DNS and we're gonna use eight dot eight dot eight dot eight So let's gonna hit enter right now now this stage guys What I've done is that I've overridden the current DNS configuration So if you have a look at the output of nmcl icon show and we go down to IPv4 DNS You can see that I no longer have the one seven two IP address So let's go and put that back So what I should have done in that case is that I should have said Plus IPv4 DNS and then specified the DNS servers that I want to make use of so at this stage. I'm gonna go and add one seven two twenty five two fifty two five four to the current list and there we go That should do it and if you have to look at the properties associated with that profile You can see right now that we have eight dot eight dot eight dot eight and one seven two twenty five two fifty two five four Now like I said the changes that I'd made are not yet put into place And if you have a look at the output of the command IPA for address S for show and we're gonna show the IP address that is currently associated with the interface that we have So it's EMP one S zero You can see that if we only have one IP address We don't have the ten dot zero dot zero dot one IP address because again We haven't sort of re-upped that profile Similarly, if you had to go and look at where our DNS server settings are stored It's inside of a file called etsyresolve.conf It's got no sort of record of eight dot eight dot eight dot eight being used in that case So what we are now going to do is run nmcli con app for wired connection So we're gonna re-upt the profile. We're gonna put into play the changes that we had made So let's go and have a look at the IP addresses That are associated with the interface and you can see that now we have the ten dot zero dot zero dot one IP address Similarly, you should find that etsyresolve.conf has been changed. So now we have more than one DNS server In fact, we have eight dot eight dot eight eight eight as the first DNS server that is being utilized over here So guys that is a very basic overview of what network manager is and how it works and how we can interface with it It's easy to use and one of my favorite features is the tab completion that is supported