Linux 101 : The Network Manager - Setting a dynamic IP address using nmcli -



We start by creating a new connection "Dynamic connection" using the below command:


Then we set the interface the connection "Dynamic connection" is going to apply to:


We set the acquisition of the IP address to dynamic:


We verify our changes:


We then save our configuration and then we quit:


We check if the changes took effect using the below command:


Remark : - "autoconnect-priority" parameter -

If we have a static connection set to "autoconnect", We could set our dhcp connection to higher priority using the "
autoconnect-priority" parameter, so that the network manager tries the dhcp connection first, and in case the dhcp connection fails, it will fall back on the static connection - which has a lower priority -.

In case we don't want that to happen we set our static connection - with the below parameter:

Comments

Leave as a comment:

Archive