“gnmic set” Command Examples

The gnmic set command is a critical component of the gnmic tool, designed for managing and configuring network devices that support the gNMI (gRPC Network Management Interface) protocol. This command provides a powerful and flexible means to modify the configuration of gNMI-enabled network devices, allowing network administrators and operators to make dynamic changes to the behavior and settings of these devices.

Key Features and Functions:

Configuration Modification: The primary purpose of the gnmic set command is to enable users to modify the configuration of network devices. This can include changes to parameters such as routing tables, access control policies, Quality of Service (QoS) settings, and any other configurable aspects of the device.

Dynamic Adaptability: Unlike static configuration methods, the set command in gNMI allows for dynamic adaptability. This means that administrators can make on-the-fly adjustments to device settings without requiring a device restart or manual intervention. This flexibility is crucial in modern network environments where changes need to be made quickly and efficiently.

gNMI Protocol: The set command leverages the gNMI protocol, which is based on gRPC. This ensures a secure and efficient means of communication between the management system and the target network device. The use of gRPC allows for bi-directional streaming, which is particularly advantageous for scenarios where continuous updates or changes are necessary.

Transactional Changes: gNMI supports transactional changes, allowing multiple modifications to be bundled together as a single transaction. This ensures atomicity, consistency, isolation, and durability (ACID properties), providing a reliable mechanism for making multiple changes to device configuration as an atomic operation.

Data Models: gNMI uses YANG data models to represent the structure and semantics of the configuration and operational data exchanged between the management system and the network device. The set command relies on these YANG models to accurately interpret and apply the requested configuration changes.

“gnmic set” Command Examples

1. Update the value of a path:

# gnmic --address ip:port set --update-path path --update-value value

2. Update the value of a path to match the contents of a json file:

# gnmic -a ip:port set --update-path path --update-file filepath

3. Replace the value of a path to match the contents of a json file:

# gnmic -a ip:port set --replace-path path --replace-file filepath

4. Delete the node at a given path:

# gnmic -a ip:port set --delete path

Conclusion

In conclusion, the gnmic set command is a powerful tool for network administrators and operators, providing a means to dynamically modify the configuration of gNMI-enabled network devices. Its support for gNMI’s efficient and secure communication protocol, transactional changes, and adherence to YANG data models make it a versatile and reliable solution for managing network configurations. As with any powerful tool, users should exercise caution, adhere to best practices, and refer to comprehensive documentation to maximize the benefits of the gnmic set command in their network management workflows.

Related Post