{"id":2286,"date":"2023-10-07T14:49:19","date_gmt":"2022-09-28T18:42:39","guid":{"rendered":""},"modified":"2025-02-02T00:46:18","modified_gmt":"2025-02-01T23:46:18","slug":"configure-networking-on-almalinux-8-centos-8-or-rocky-linux-8-with-nmcli-command","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/configure-networking-on-almalinux-8-centos-8-or-rocky-linux-8-with-nmcli-command\/","title":{"rendered":"Configure Networking on AlmaLinux 8, CentOS 8, or Rocky Linux 8 with nmcli Command"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<article>\n<p>Configuring network settings is an essential task when managing servers. The <code>nmcli<\/code> command-line tool provides a straightforward way to manage NetworkManager from the terminal. In this guide, we will walk you through 20 examples of configuring networking on AlmaLinux 8, CentOS 8, or Rocky Linux 8 using the <code>nmcli<\/code> command. Whether you are deploying it on a local server or using a , this tutorial covers all the necessary steps.<\/p>\n<section>\n<h2>Step 1: Check Network Status<\/h2>\n<p>To check the status of your network interfaces, use the following command:<\/p>\n<pre><code>nmcli device status<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 2: List Available Network Connections<\/h2>\n<p>To list all available network connections, run:<\/p>\n<pre><code>nmcli connection show<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 3: Create a New Connection<\/h2>\n<p>To create a new connection, use:<\/p>\n<pre><code>nmcli connection add type ethernet con-name my-connection ifname eth0<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 4: Set a Static IP Address<\/h2>\n<p>To set a static IP address, use:<\/p>\n<pre><code>\r\nnmcli connection modify my-connection ipv4.addresses 192.168.1.100\/24\r\nnmcli connection modify my-connection ipv4.gateway 192.168.1.1\r\nnmcli connection modify my-connection ipv4.dns 8.8.8.8\r\nnmcli connection modify my-connection ipv4.method manual\r\n            <\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 5: Enable the Connection<\/h2>\n<p>To enable the newly created connection, run:<\/p>\n<pre><code>nmcli connection up my-connection<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 6: Set Up DHCP<\/h2>\n<p>To set up DHCP for an existing connection, use:<\/p>\n<pre><code>nmcli connection modify my-connection ipv4.method auto<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 7: View Current IP Address<\/h2>\n<p>To view the current IP address assigned to your interface, use:<\/p>\n<pre><code>nmcli -p device show eth0<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 8: Delete a Connection<\/h2>\n<p>To delete a specific connection, run:<\/p>\n<pre><code>nmcli connection delete my-connection<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 9: Modify a Connection<\/h2>\n<p>To modify an existing connection, use:<\/p>\n<pre><code>nmcli connection modify my-connection ipv4.addresses 192.168.1.101\/24<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 10: Set Connection to Auto-Connect<\/h2>\n<p>To make a connection auto-connect at boot, use:<\/p>\n<pre><code>nmcli connection modify my-connection connection.autoconnect yes<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 11: Disable a Connection<\/h2>\n<p>To disable a connection, run:<\/p>\n<pre><code>nmcli connection down my-connection<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 12: Restart NetworkManager<\/h2>\n<p>If you need to restart NetworkManager, use:<\/p>\n<pre><code>sudo systemctl restart NetworkManager<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 13: View Connection Details<\/h2>\n<p>To view detailed information about a connection, use:<\/p>\n<pre><code>nmcli connection show my-connection<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 14: Configure VLANs<\/h2>\n<p>To create a VLAN connection, run:<\/p>\n<pre><code>\r\nnmcli connection add type vlan con-name my-vlan ifname eth0 id 10\r\n            <\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 15: Set up Bridge Connection<\/h2>\n<p>To create a bridge connection, use:<\/p>\n<pre><code>nmcli connection add type bridge con-name my-bridge ifname br0\r\nnmcli connection add type ethernet con-name my-bridge-slave ifname eth0 master br0\r\n            <\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 16: Monitor Network Activity<\/h2>\n<p>To monitor network activity, use:<\/p>\n<pre><code>nmcli monitor<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 17: Set MTU<\/h2>\n<p>To set the MTU (Maximum Transmission Unit) for a connection, use:<\/p>\n<pre><code>nmcli connection modify my-connection 802-3-ethernet.mtu 1500<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 18: Set IPv6 Configuration<\/h2>\n<p>To enable IPv6 and set its configuration, run:<\/p>\n<pre><code>\r\nnmcli connection modify my-connection ipv6.method auto\r\n            <\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 19: Backup Connection Configuration<\/h2>\n<p>To backup your connection configuration, copy the configuration file:<\/p>\n<pre><code>nmcli connection export my-connection &gt; my-connection.backup<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 20: Restore Connection Configuration<\/h2>\n<p>To restore a connection configuration from a backup, run:<\/p>\n<pre><code>nmcli connection import my-connection.backup<\/code><\/pre>\n<\/section>\n<footer>\n<p>You have learned how to configure networking on AlmaLinux 8, CentOS 8, or Rocky Linux 8 using the <code>nmcli<\/code> command with 20 practical examples. For reliable and scalable hosting solutions, consider using . They offer a variety of hosting options, including <strong>windows virtual private servers<\/strong>, <strong>windows vps hosting<\/strong>, and <strong>windows virtual dedicated server hosting<\/strong>. Whether you&#8217;re looking for <strong>windows vps italy<\/strong> or <strong>uk vps windows<\/strong> solutions, their hosting services provide the performance and flexibility needed to support your networking tasks.<\/p>\n<\/footer>\n<\/article>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Configuring network settings is an essential task when managing servers. The nmcli command-line tool provides a straightforward way to manage NetworkManager from the terminal. In this\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2286","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2286"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2286\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}