How do you configure an existing connection called 'lab' with a specific IP address, mask and gateway using nmcli?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Prepare for the Red Hat Certified Architect Exam with our comprehensive quiz. Master your skills with multiple choice questions and detailed explanations. Gear up to excel!

To configure an existing connection named 'lab' with a specific IP address, subnet mask, and gateway using nmcli, the command should modify the current settings of the connection rather than attempt to create a new one or incorrectly format the command.

The correct choice involves using the nmcli con mod command, which is specifically designed for modifying existing connections. By using ipv4.addresses, you can specify multiple settings: the IP address along with the subnet mask, which is represented in CIDR notation (e.g., "172.25.1.10/24"), and you can also specify the gateway as part of the same command by separating them with a space.

This allows the user to succinctly set both the IP address and the associated gateway in one operation. Hence, the use of 'mod' indicates that you are altering an existing connection, which is appropriate in this context, as 'lab' is already established.

This approach ensures that the existing settings for the connection are retained while specifying the new IP configuration, making it both efficient and effective for network management. Other choices do not properly utilize the correct syntax or command structure for modifying an existing connection in nmcli.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy