{"id":24006,"date":"2024-01-31T13:20:25","date_gmt":"2024-01-31T13:20:25","guid":{"rendered":"https:\/\/linuxways.net\/?p=24006"},"modified":"2024-01-31T13:25:57","modified_gmt":"2024-01-31T13:25:57","slug":"get-an-ip-address-debian-12","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/get-an-ip-address-debian-12\/","title":{"rendered":"How to Get an IP Address on Debian 12"},"content":{"rendered":"<p><strong>Internet Protocol <\/strong>generally known as <strong>IP<\/strong> is a unique code assigned to a device connected to the Internet. All the running applications and services over the internet on <strong>Debian 12<\/strong> use this <strong>IP address <\/strong>to route the data to and from the internet. Knowing your system&#8217;s IP address is important because it&#8217;s required when troubleshooting network-related issues. The IP address is also required while accessing another system.<\/p>\n<p>The <strong>IP address<\/strong> is divided into two basic categories: <strong>Public <\/strong>and <strong>Private<\/strong>; the <strong>private IP address<\/strong> is the one that is assigned by the network router to each device and the <strong>public IP address <\/strong>is assigned by your ISP provider that acts as your network identification on the internet. The <strong>private IP address<\/strong> only works within your local network while a <strong>public IP address<\/strong> can be used to access the online resources.<\/p>\n<p>In this guide, you will learn:<\/p>\n<ul>\n<li><a href=\"#post-24006-_92l6soicdu6e\"><strong>How to Get an IP Address on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-24006-_aa69p8nzzhw4\"><strong>Bonus Method: How to Get Public IP Address on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-24006-_r8x37rxs7640\"><strong>Conclusion<\/strong><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24006-_92l6soicdu6e\"><\/a><strong>How to Get an IP Address on Debian 12<\/strong><\/h2>\n<p>The following are the two ways to get an IP address on Debian 12:<\/p>\n<ul>\n<li><a href=\"#post-24006-_20fi3ep80arl\"><strong>Method 1: Through GUI<\/strong><\/a><\/li>\n<li><a href=\"#post-24006-_9nvnr6l5zcpf\"><strong>Method 2: Through the Command Line<\/strong><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24006-_20fi3ep80arl\"><\/a><strong>Method 1: How to Get an IP Address on Debian 12 Through GUI<\/strong><\/h2>\n<p>You can get an IP address on Debian 12 through GUI using the below steps:<\/p>\n<p><strong>Step 1:<\/strong> First, click on the <strong>cog icon <\/strong>from the top right corner and then expand the <strong>Wired<\/strong> option:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"458\" class=\"wp-image-24024\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-1.png 780w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-1-300x176.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-1-768x451.png 768w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/p>\n<p><strong>Step 2:<\/strong> Next, click on the <strong>Wired Settings<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"777\" height=\"482\" class=\"wp-image-24047\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-2.png 777w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-2-300x186.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-2-768x476.png 768w\" sizes=\"auto, (max-width: 777px) 100vw, 777px\" \/><\/p>\n<p><strong>Step 3:<\/strong> The <strong>Network settings<\/strong> will appear on your screen, click on the <strong>gear icon<\/strong> present in front of the connected network, also highlighted in the below image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"828\" height=\"472\" class=\"wp-image-24061\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-3.png 828w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-3-300x171.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-3-768x438.png 768w\" sizes=\"auto, (max-width: 828px) 100vw, 828px\" \/><\/p>\n<p><strong>Step 4: <\/strong>The prompt will appear, with the information of the connected network. It also contains the <strong>IP address <\/strong>of your Debian 12 system:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"832\" height=\"471\" class=\"wp-image-24076\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-4.png 832w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-4-300x170.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-4-768x435.png 768w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24006-_9nvnr6l5zcpf\"><\/a><strong>Method 2: How to Get an IP Address on Debian 12 Through the Command Line<\/strong><\/h2>\n<p>The following commands are used to find the IP address on Debian 12:<\/p>\n<ul>\n<li><a href=\"#post-24006-kix.ohtxcsn58f7p\"><strong>ip Command<\/strong><\/a><\/li>\n<li><a href=\"#post-24006-kix.8q0wlo2be228\"><strong>ifconfig Command<\/strong><\/a><\/li>\n<li><a href=\"#post-24006-kix.qzfw081nspfj\"><strong>nmcli<\/strong><\/a><\/li>\n<li><a href=\"#post-24006-kix.9v57ze2bfxa4\"><strong>hostname<\/strong><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><strong>1: How to Get an IP Address on Debian 12 Using ip Command<\/strong><\/h3>\n<p>The <strong>ip command<\/strong> is mostly used commands on Linux systems for configuring network interfaces. Using the following command, you can display all devices and get the IP address of the connected device on your Debian 12:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ip addr<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"828\" height=\"425\" class=\"wp-image-24096\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-5.png 828w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-5-300x154.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-5-768x394.png 768w\" sizes=\"auto, (max-width: 828px) 100vw, 828px\" \/><\/p>\n<p><strong>Note:<\/strong> If your device is connected with Wi-Fi, the IP address will appear in <strong>wlan0<\/strong>.<\/p>\n<p>Another<strong> ip command <\/strong>that shows the IP address of the network on Debian is written below:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ip addr<\/span> show<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"797\" height=\"408\" class=\"wp-image-24112\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-6.png 797w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-6-300x154.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-6-768x393.png 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/><\/p>\n<p>You can also find the IP address of a specific interface using the following syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ip addr<\/span> show dev <span class=\"br0\">&#91;<\/span>interface<span class=\"br0\">&#93;<\/span><\/div><\/div>\n<p>In my case, I am finding the IP address of <strong>enp0s3 <\/strong>on my Debian 12:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ip addr<\/span> show dev enp0s3<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"798\" height=\"368\" class=\"wp-image-24120\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-7.png 798w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-7-300x138.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-7-768x354.png 768w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><\/p>\n<p><strong>Note: <\/strong>The digits after the slash i.e.<strong> \/24<\/strong> and <strong>\/64 <\/strong>represent the network size.<\/p>\n<p>The below command provides comprehensive details about the interfaces including the IP address:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ip<\/span> a<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"828\" height=\"407\" class=\"wp-image-24129\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-8.png 828w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-8-300x147.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-8-768x378.png 768w\" sizes=\"auto, (max-width: 828px) 100vw, 828px\" \/><\/p>\n<p>The <strong>ip command <\/strong>can be used with the<strong> r<\/strong> option to get the local IP address on Debian 12:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">ip<\/span> r<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"160\" class=\"wp-image-24137\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-9.png 734w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-9-300x65.png 300w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>2: How to Get an IP Address on Debian 12 Using ifconfig Command<\/strong><\/h3>\n<p>The <strong>ifconfig <\/strong>is another command used to find the local <strong>IP address <\/strong>on <strong>Debian 12<\/strong>. To execute this command, you must install the <strong>net-tools <\/strong>utility on your system through the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> net-tools<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"813\" height=\"322\" class=\"wp-image-24144\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-10.png 813w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-10-300x119.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-10-768x304.png 768w\" sizes=\"auto, (max-width: 813px) 100vw, 813px\" \/><\/p>\n<p>Once the <strong>net-tools <\/strong>utility is successfully installed on your<strong> Debian 12<\/strong>, run the below command to get the <strong>IP address. <\/strong>The system will check the virtual, connected, and disconnected networks and display the IP address:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">ifconfig<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"423\" class=\"wp-image-24153\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-11.png 772w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-11-300x164.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-11-768x421.png 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/p>\n<p>In the above screenshot, the <strong>inet <\/strong>refers to the <strong>IPv4 address <\/strong>and<strong> inet6 <\/strong>refers to <strong>IPV6.<\/strong><\/p>\n<p>Another <strong>ifconfig <\/strong>command used to identify the <strong>IP address<\/strong> of each interface on your <strong>Debian 12 <\/strong>is written below:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"sy0\">\/<\/span>sbin<span class=\"sy0\">\/<\/span><span class=\"kw2\">ifconfig<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"788\" height=\"400\" class=\"wp-image-24160\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-12.png 788w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-12-300x152.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-12-768x390.png 768w\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>3: How to Get an IP Address on Debian 12 Using nmcli Command<\/strong><\/h3>\n<p><strong>Debian 12 <\/strong>uses the network manager command-line tool called <strong>nmcli <\/strong>to manage the network configurations of the system. You can use the following <strong>nmcli command <\/strong>to get an IP address from the terminal in <strong>Debian 12<\/strong>:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">nmcli <span class=\"re5\">-p<\/span> device show<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"823\" height=\"423\" class=\"wp-image-24166\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-13.png 823w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-13-300x154.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-13-768x395.png 768w\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>4: How to Get an IP Address on Debian 12 Using hostname Command<\/strong><\/h3>\n<p>The <strong>hostname <\/strong>command is also used to display the system&#8217;s DNS name and other system-related information such as IP address. To get the <strong>IP address<\/strong> of your system, execute the <strong>hostname <\/strong>command with the -I flag on <strong>Debian 12<\/strong>:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">hostname<\/span> <span class=\"re5\">-I<\/span><\/div><\/div>\n<p>The <strong>IP address<\/strong> of the system should be printed on the console.<\/p>\n<p><strong>Note: <\/strong>The above methods will help you identify the private IP address of your device.<\/p>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24006-_aa69p8nzzhw4\"><\/a><strong>Bonus Method: How to Get Public IP Address on Debian 12<\/strong><\/h2>\n<p>Besides getting the <strong>private IP address<\/strong>, you can also find the <strong>public IP address <\/strong>of your system by running the following <strong>curl <\/strong>command that provides you with complete information about your network including its <strong>public IP address<\/strong>:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl ipinfo.io.<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"698\" height=\"271\" class=\"wp-image-24173\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-15.png 698w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-15-300x116.png 300w\" sizes=\"auto, (max-width: 698px) 100vw, 698px\" \/><\/p>\n<p>To get only a <strong>public IP address<\/strong> on Debian 12, use the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl ifconfig.io<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"118\" class=\"wp-image-24177\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-16.png 709w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/01\/word-image-24006-16-300x50.png 300w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><a id=\"post-24006-_r8x37rxs7640\"><\/a><strong>Conclusion<\/strong><\/h2>\n<p>The <strong>IP address <\/strong>is the specific address of any user working on the internet. In many cases, we need to know the IP address of our system as it is required to communicate with the other network users. On Debian 12, you can get the IP address through the terminal or the network settings. You can use numerous commands such as the <strong>ip command<\/strong>, <strong>ifconfig<\/strong>, <strong>nmcli<\/strong>, and <strong>hostname <\/strong>on the terminal to find the IP address. We have discussed these mentioned commands in the above section of this post.<\/p>","protected":false},"excerpt":{"rendered":"<p>You can get an IP address on Debian 12 from the network settings or using the ip, ifconfig, nmcli, and hostname commands in the CLI.<\/p>","protected":false},"author":115,"featured_media":24199,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-24006","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24006","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\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=24006"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24006\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/24199"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=24006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=24006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=24006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}