{"id":2631,"date":"2020-12-15T18:04:13","date_gmt":"2020-12-15T18:04:13","guid":{"rendered":"https:\/\/linuxways.net\/?p=2631"},"modified":"2020-12-15T18:04:16","modified_gmt":"2020-12-15T18:04:16","slug":"6-ways-to-find-your-private-ip-address-in-centos-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/6-ways-to-find-your-private-ip-address-in-centos-8\/","title":{"rendered":"6 Ways to Find Your Private IP Address in CentOS 8"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Private IP addresses are used to communicate inside a local network. Private IP addresses cannot be routed and hence no traffic can be sent to them from the external network. There may come a time when you need to know the private IP address of your system like to setup a network-related application, to enable remote administration, or for troubleshooting, etc. In our previous posts, we have shared with you some ways to find the private IP address in <a href=\"https:\/\/linuxways.net\/de\/ubuntu\/how-to-find-your-ip-address-in-ubuntu-20-04-lts\/\">Ubuntu<\/a> and <a href=\"https:\/\/linuxways.net\/de\/debian\/how-to-find-your-private-ip-address-in-debian-10\/\">Debian<\/a> OS.<\/p>\n<p>In this post, we will describe some methods to find the private IP address in CentOS8. These methods involve both the command line and GUI based methods.<\/p>\n<p>Following are the IP address ranges that are defined by IANA:<\/p>\n<pre>10.0.0.0\/8=10.0.0.0 \u2013 10.255.255.255\n\n192.168.0.0\/16=192.168.0.0 \u2013 192.168.255.255\n\n172.16.0.0\/12=172.16.0.0 \u2013 172.31.255.255<\/pre>\n<h2>6 Ways to find private IP address in CentOS 8<\/h2>\n<h3>Method # 1: The \u201cip\u201d command<\/h3>\n<p>The most common way to find an IP address in CentOS is by using the &#8220;ip&#8221; command. Simply type <em>ip<\/em> followed by the <strong>&#8220;<\/strong>addr&#8221; or &#8220;a&#8221; option:<\/p>\n<pre>$ ip a<\/pre>\n<p>or<\/p>\n<pre>$ ip addr<\/pre>\n<p>This command will display all the network interfaces along with their associated private IP addresses. The following output shows our private IP is 192.168.72.130\/24.<\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" width=\"1117\" height=\"318\" class=\"wp-image-2632\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-277.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-277.png 1117w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-277-300x85.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-277-1024x292.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-277-768x219.png 768w\" sizes=\"auto, (max-width: 1117px) 100vw, 1117px\" \/><\/h3>\n<h3>Method # 2: The \u201cifconfig\u201d command<\/h3>\n<p>The \u201cifconfig\u201d command is also used to find the private IP address. To use this command, just type <em>ifconfig<\/em> in the terminal:<\/p>\n<pre>$ ifconfig<\/pre>\n<p>If running the above command gives you a &#8220;command not found&#8221; error, then you will have to first install the net-tools as follows:<\/p>\n<pre>$ sudo yum -y install net-tools<\/pre>\n<p>Once installed, you can then use it to find the private IP address.<\/p>\n<p>This command will display all the network interfaces along with their associated private IP addresses. The following output shows our private IP is 192.168.72.130\/24.<\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" width=\"859\" height=\"391\" class=\"wp-image-2633\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-278.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-278.png 859w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-278-300x137.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-278-768x350.png 768w\" sizes=\"auto, (max-width: 859px) 100vw, 859px\" \/><\/h3>\n<h3>Method # 3: The \u201chostname\u201d command<\/h3>\n<p>The &#8220;hostname&#8221; command is usually used to find the hostname of the system. However, using the hostname command with the -l option provides you with IP address information.<\/p>\n<pre><strong>$ hostname -I<\/strong><\/pre>\n<p>Following is the output of above command which shows our private IP is 192.168.72.130.<\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" width=\"398\" height=\"66\" class=\"wp-image-2634\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-279.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-279.png 398w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-279-300x50.png 300w\" sizes=\"auto, (max-width: 398px) 100vw, 398px\" \/><\/h3>\n<h3>Method # 4: The \u201cnmcli\u201d command<\/h3>\n<p>The \u201cnmcli\u201d is a command-line utility for controlling NetworkManager. It can also be used to find the private IP address of your system.<\/p>\n<pre><strong>$ nmcli<\/strong><\/pre>\n<p>Here is the output of the nmcli command which shows the private address on our system is 192.168.72.130\/24.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"642\" height=\"280\" class=\"wp-image-2635\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-280.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-280.png 642w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-280-300x131.png 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/strong><\/p>\n<h3><strong><strong>Method 5: Using ip route command<\/strong><\/strong><\/h3>\n<p>The \u201cip route\u201d command is used to configure and display static routes in Linux OS. This command also shows the private IP address of a system. Issue the following command in Terminal to find your private IP address:<\/p>\n<pre>$ ip route<\/pre>\n<p>Here is the output of the nmcli command which shows the private address on our system is 192.168.72.130\/24.<\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"93\" class=\"wp-image-2636\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-281.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-281.png 900w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-281-300x31.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-281-768x79.png 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/h3>\n<h3><strong><strong>Method 6: Using GUI<\/strong><\/strong><\/h3>\n<p>This method is for all those users who prefer working on GUI instead of the command line. In order to find the private IP address via GUI, click the network icon in the top right corner of your desktop. This step is also highlighted in the following screenshot.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1009\" height=\"115\" class=\"wp-image-2637\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-282.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-282.png 1009w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-282-300x34.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-282-768x88.png 768w\" sizes=\"auto, (max-width: 1009px) 100vw, 1009px\" \/><\/p>\n<p>Then a menu will show up on your desktop. Click the <strong>Wired Connected<\/strong> option.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"336\" height=\"308\" class=\"wp-image-2638\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-283.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-283.png 336w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-283-300x275.png 300w\" sizes=\"auto, (max-width: 336px) 100vw, 336px\" \/><\/p>\n<p>Then select <strong>Wired Settings<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"330\" height=\"367\" class=\"wp-image-2639\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-284.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-284.png 330w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-284-270x300.png 270w\" sizes=\"auto, (max-width: 330px) 100vw, 330px\" \/><\/p>\n<p>The <strong>Settings<\/strong> window will appear in the <strong>Network<\/strong> view. Click the cog icon in front of the network interface also shown highlighted in the following screenshot.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"843\" height=\"441\" class=\"wp-image-2640\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-285.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-285.png 843w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-285-300x157.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-285-768x402.png 768w\" sizes=\"auto, (max-width: 843px) 100vw, 843px\" \/><\/p>\n<p>Now the following window will open in the <strong>Details<\/strong> tab. Here you will find your private IP address in the <strong>Details<\/strong> tab which in our case is 192.168.72.130.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"593\" height=\"539\" class=\"wp-image-2641\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-286.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-286.png 593w, https:\/\/linuxways.net\/wp-content\/uploads\/2020\/12\/word-image-286-300x273.png 300w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/p>\n<p>In this post, we have described several ways through which you can find the private IP address in CentOS 8. If you know of some other ways that we have missed for finding the private IP address in CentOS, please share with us in the comments!<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction Private IP addresses are used to communicate inside a local network. Private IP addresses cannot be routed and hence no traffic can be sent to them from&hellip;<\/p>","protected":false},"author":4,"featured_media":2644,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[93,88],"class_list":["post-2631","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-centos-8","tag-private-ip-address"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/2631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=2631"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/2631\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/2644"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=2631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=2631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=2631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}