And I think it's about time we dropped out to our Red Hat‑based system,
Alma Linux 8, where we can go through and take a look at our
NetworkManager. Now here, we've got a command line utility, nmcli. If
you're using a graphical desktop‑based system, you've also got an applet
that you could use to do the same type of things, but we can see the
different connections that we will have.
These connections will point to a similar location to openSUSE. Here,
they're actually in the network‑scripts subdirectory. We can go back to
the nmcli command to go through and modify our connection. Here, we're
adding in two IP addresses, the existing one that we have, plus the
additional 172 address.
This is going to change it in the back end, and we can also use
nmcli to be able to read it into the front end.
We can see from our back end configuration file the changes that have
been made, and we can bring down the connection and bring it back up
again to be able to see the front end changes.
So why don't we go through and take a look at this now working on our Alma
Linux 8 system and investigating a little bit about NetworkManager. And here
we are then working on our Alma Linux 8 system.
If I go through a run my IP address show, we can see that I've still got
that 172 address that we've been working with, but I can go through and
delete that. So I can use ip a d, and then the address, 172.16.1.2./16,
and from the device, so dev enp0s8.
So just in the same way as I can add it with ip address add, I
can remove it with ip address and delete.
So we're back now having a clean configuration. And when
we go through and take a look at that,
even if I want to look at it for that device, enp0s8, it's looking very
clean now with only the .11 address assigned to it.
We're going to look at how we can add in the IP address in the back end
and have it read into our front end, and we can do that through nmcli. If
I use nmcli, all I've got to do is type co and then tab completion, same
way, shh for show and use tab completion. We can see then that I've got
two active connections.
I've also got a connection that I'm not currently using.
It's not active.
It's not connected to any device, and that's Wired connection 1.
Now, I don't know why that's here.
Maybe it's something I was working on previously on this system, but I
know that I don't need it. So we can go through and remove that
connection with the nmcli command. Anything we can add, we can take away.
Anything that's there, we can also modify.
So I can use then my nmcli and connection, but rather than
using the connection show, I can go through and run a
connection delete. With all of this, we're able to use tab completion.
So even for that wired connection,
all I need to do is put the uppercase W and then hit the tab key.
So I say this is a lot easier to actually run than to demonstrate
or talk about because it's not until you realize the power of the
tab completion are you going to realize, actually, it's really
quite simple. But there you go.
I've got my two connections that I want for the two network cards I
have. If I look at the back end storage of this,
I can run through to /etc/sysconfig, but this time we're looking in the
network‑scripts directory rather than just networks, and it was on OpenSUSE. But
we still have those same ifcfg files, and they're in the same format. As I then
go through and take a look at this, we've got an entry for an IP address, but
it's just ip addr =. We don't have any supplementary IP addresses, so this is if
you like the same sort of configuration that we were looking at when we were
seeing our configuration on openSUSE. So we can go through and start to modify
this.
We don't need to write directly to the file. NetworkManager is going to do that
for us. So I can use, again, my nmcli command and my connection, but this time
it's modify. Again, I'm just going to put uppercase Sy and use tab completion.
And then I have to put the properties.
Now I know it's going to be IPv4, and then dot, and then I type
ad and then tab completion for addresses.
This is a list that we add in, 192.168.33.11/24.
That's our original one, so comma‑separated, so commas, not spaces.
And then we add in another address, 172.16.1.2/16,
and just hit your big Enter key.
That's it, done. Now we've changed the back end,
not the front end, currently. We can go through and look our IPv4 address show
for our device, and we can see there that we've still got just the one IP
address assigned to it. But in the back end, we've assigned more. I can go
through and use !cat to recall the last cat command. And now when we take a
look at this towards the bottom,
we've got our IPADDR1, our PREFIX1, and our NETMASK1, so
additional IP address configurations that we've made.
Okay, to read this in, we can go back to my connection, and we
can then go through and run down for our system enp0s8, and
then just bring it back up again.
Now with that done and dusted, we will also have it in our front end.
So even though it's a terrifying command to take a look at, nmcli, it's a
lot more friendly than we would at first imagine. Just take the caveat
though that we are working with Vagrant virtual machines from a Vagrant
file. It's a Vagrant file that is really configuring these interfaces, so
anything that we make in our changes here can be overwritten by Vagrant when
it restarts the system.
But we're getting the idea of how we're working with our own
machines that we're not managing through third‑party utilities how we can make changes.