\begin{exe} {Adding a Network Interface Alias/Address using  \textbf{nmcli}}


   We are going to add an additional IPv4 address to your
   system and make it persistent.  We will do this
   without editing files under \filelink{/dev} directly,
   using \textbf{nmcli}.

   \begin{enumerate}

      \item
      First obtain your current internet address and interface
      name:
      \begin{cmd}
$ sudo nmcli con
      \end{cmd}
      \begin{response}
NAME           UUID                                  TYPE            DEVICE
Auto Ethernet  1c46bf37-2e4c-460d-8b20-421540f7d0e2  802-3-ethernet  ens33
virbr0         a84a332f-38e3-445a-a377-4363a8eb963f  bridge          virbr0
      \end{response}
      shows the name of the connection is \verb?Auto Ethernet?.
      \begin{cmd}
$ sudo nmcli con show "Auto Ethernet" | grep IP4.ADDRESS
      \end{cmd}
      \begin{response}
IP4.ADDRESS[1]:                         172.16.2.135/24
      \end{response}
      shows the address as \verb?172.16.2.135?  Note that this
      command shows all information about the connection and
      you could have specified the \verb?UUID? instead of the
      \verb?NAME?  as in:
      \begin{cmd}
$ nmcli con show 1c46bf37-2e4c-460d-8b20-421540f7d0e2
      \end{cmd}
      \item
      Add a new address that your machine can be seen by:
      \begin{cmd}
$ sudo nmcli con modify "Auto Ethernet" +ipv4.addresses 172.16.2.140/24
      \end{cmd}
      \item
      Activate it and test to see if it is there:
      \begin{cmd}
$ sudo nmcli con up "Auto Ethernet"
      \end{cmd}
      \begin{response}
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)

$ ping -c 3 172.16.2.140
PING 172.16.2.140 (172.16.2.140) 56(84) bytes of data.
64 bytes from 172.16.2.140: icmp_seq=1 ttl=64 time=0.038 ms
64 bytes from 172.16.2.140: icmp_seq=2 ttl=64 time=0.034 ms
64 bytes from 172.16.2.140: icmp_seq=3 ttl=64 time=0.032 ms

--- 172.16.2.140 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.032/0.034/0.038/0.007 ms
      \end{response}

      \item
      Clean up by removing the alias:
      \begin{cmd}
$ sudo nmcli con modify  "Auto Ethernet" -ipv4.addresses 172.16.2.140/24
...
$ sudo nmcli con up "Auto Ethernet"
...
      \end{cmd}
   \end{enumerate}
\end{exe}

