Trevor
Starfighter Starfighter
Starfighter
  • 412 Views

ip or nmcli

When managing my network configurations, when do I use
ip vs nmcli?

 

 

Trevor "Red Hat Evangelist" Chandler
Labels (3)
8 Replies
Blue_bird
Flight Engineer
Flight Engineer
  • 385 Views

On Red Hat systems, we use nmcli for managing NetworkManager connections (creating, editing, activating, etc.), while ip is used for displaying and  low-level network device, routing, and tunnel manipulation.

Thanks

Trevor
Starfighter Starfighter
Starfighter
  • 378 Views

Thank you for your response!

Trevor "Red Hat Evangelist" Chandler
sam2019
Moderator
Moderator
  • 365 Views

@Trevor , you are more likely to find 'ip' on systems with a small footprint - servers with small images , or on containers. Also its easier to script with 'ip'. 

Thanks.

Trevor
Starfighter Starfighter
Starfighter
  • 360 Views

Thanks for your reply sam2019!

Trevor "Red Hat Evangelist" Chandler
flozano
Moderator
Moderator
  • 335 Views

I use nmcli (which is scriptable, by design) to manage configurations and make persistent changes. I use ip mostly for querying, and for ad-hoc changes that I don't intent to persist after the next boot.

Chetan_Tiwary_
Community Manager
Community Manager
  • 316 Views

Genrally speaking nmcli is used for high level network configurations ( and scripting ) which interacts with NetworkManager whereas ip , which is provided by iproute2 utility collection, interacts directly with kernel to manipulate low level control and used for troubleshooting purposes.

I frequently use ip command utilities for quickly gathering network info and for troubleshooting purposes.

In a nutshell : The nmcli and ip commands serve distinct purposes in network management. nmcli offers a high-level abstraction by managing network connections and profiles through interaction with NetworkManager. Consequently, configurations made with nmcli are usually persistent. Its typical use cases include standard network management tasks and scripting. In contrast, the ip command provides low-level control by directly interacting with the Linux kernel. Its focus is on network devices, addresses, routing, and neighbors, and changes made with ip are often temporary unless explicitly saved. The primary use cases for ip involve low-level control, troubleshooting network issues, and managing networks in minimal environments.

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/networking_guide/sec-config...

https://wiki.linuxfoundation.org/networking/iproute2

Trevor
Starfighter Starfighter
Starfighter
  • 285 Views

A terrific nutshell explanation!!!!

Trevor "Red Hat Evangelist" Chandler
Trevor
Starfighter Starfighter
Starfighter
  • 285 Views

Another little something for your viewing pleasure!

 

Trevor_0-1744343495390.png

 

Trevor "Red Hat Evangelist" Chandler
Join the discussion
You must log in to join this conversation.