{"id":619,"date":"2023-10-19T14:52:24","date_gmt":"2023-10-19T06:52:24","guid":{"rendered":"http:\/\/madapapa.com\/wordpress\/?p=619"},"modified":"2023-10-19T15:32:38","modified_gmt":"2023-10-19T07:32:38","slug":"zai-su-zhu-ji-he-rong-qi-li-fen-bie-cha-kanip-de-z","status":"publish","type":"post","link":"http:\/\/madapapa.com\/wordpress\/?p=619","title":{"rendered":"\u5728\u5bbf\u4e3b\u673a\u548c\u5bb9\u5668\u91cc\uff0c\u5206\u522b\u67e5\u770bip\u5730\u5740"},"content":{"rendered":"<p>\u5728mac\u4e0a\u67e5\u770bip\u5730\u5740\uff0c\u6bd4\u8f83\u65b9\u4fbf\u7684\u547d\u4ee4\u662f<\/p>\n<pre><code class=\"language-plain_text\">ifconfig en0 | grep inet\n<\/code><\/pre>\n<h2><a id=\"%E8%BF%99%E6%9D%A1%E5%91%BD%E4%BB%A4%E7%9A%84%E8%A7%A3%E9%87%8A%E5%A6%82%E4%B8%8B\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u8fd9\u6761\u547d\u4ee4\u7684\u89e3\u91ca\u5982\u4e0b<\/h2>\n<ol>\n<li>Executes the &quot;ifconfig&quot; command to retrieve network configuration information for the &quot;en0&quot; network interface.<\/li>\n<li>Pipes (|) the output of the &quot;ifconfig&quot; command to the &quot;grep inet&quot; command.<\/li>\n<li>The &quot;grep&quot; command searches through the output and extracts any lines that contain the word &quot;inet.&quot;<\/li>\n<\/ol>\n<p>\u8f93\u51fa\u5982\u4e0b\u56fe<br \/>\n<img decoding=\"async\" src=\"http:\/\/madapapa.com\/wordpress\/wp-content\/uploads\/2023\/10\/16976998614402.jpg\" alt=\"\" \/><\/p>\n<p>\u53e6\u5916\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u67e5\u770bip\u5730\u5740\uff0c\u53ef\u4ee5\u53d1\u73b0\u5728\u5bbf\u4e3b\u673a\u548c\u5bb9\u5668\u91cc\uff0c\u663e\u793a\u7684ip\u5730\u5740\u662f\u76f8\u540c\u7684\u3002<\/p>\n<pre><code class=\"language-plain_text\"># curl ifconfig.me\n1.193.44.59#\n<\/code><\/pre>\n<p>\u5bbf\u4e3b\u673a<br \/>\n<img decoding=\"async\" src=\"http:\/\/madapapa.com\/wordpress\/wp-content\/uploads\/2023\/10\/16977006234463.jpg\" alt=\"\" \/><\/p>\n<p>\u5bb9\u5668<br \/>\n<img decoding=\"async\" src=\"http:\/\/madapapa.com\/wordpress\/wp-content\/uploads\/2023\/10\/16977006395060.jpg\" alt=\"\" \/><\/p>\n<h2><a id=\"%E8%A7%A3%E9%87%8A%E5%A6%82%E4%B8%8B\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u89e3\u91ca\u5982\u4e0b<\/h2>\n<ul>\n<li>\n<p>The command &quot;curl ifconfig.me&quot; is used to make an HTTP request to the ifconfig.me website, which is a service that provides your public IP address.<\/p>\n<\/li>\n<li>\n<p>In the output you provided, &quot;1.193.44.59&quot; is the public IP address that was returned by the ifconfig.me service in response to your request. This is the public IP address that your device is using to communicate with the internet. It&#8217;s the address that other devices on the internet will see when they interact with your device.<\/p>\n<\/li>\n<li>\n<p>Please note that public IP addresses can change, especially if you are using a dynamic IP assignment from your Internet Service Provider (ISP), so the IP address you see here may not be constant and could change over time.<\/p>\n<\/li>\n<\/ul>\n<p>\u5728\u5bb9\u5668\u7684bash\u73af\u5883\u91cc\uff0c\u8f93\u5165hostname -i\uff0c\u663e\u793a\u5f53\u524d\u5bb9\u5668\u5bf9\u5916\u66b4\u9732\u7684ip\u5730\u5740<\/p>\n<pre><code class=\"language-plain_text\"># hostname -i\nXXX:XXXX:XXXa::d 192.168.194.13\n<\/code><\/pre>\n<h2><a id=\"%E8%BF%99%E6%9D%A1%E5%91%BD%E4%BB%A4%E8%A7%A3%E9%87%8A%E5%A6%82%E4%B8%8B\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u8fd9\u6761\u547d\u4ee4\u89e3\u91ca\u5982\u4e0b<\/h2>\n<ul>\n<li>\n<p>The command &quot;hostname -i&quot; is used to display the IP addresses associated with the current host or system. In the output you provided, you have two IP addresses listed:<\/p>\n<ol>\n<li>d07:b51a:cc66:a::d: This is an IPv6 address. IPv6 is the next-generation Internet Protocol designed to replace IPv4 due to the exhaustion of available IPv4 addresses.<\/li>\n<li>192.168.194.13: This is an IPv4 address. IPv4 is the older and more widely used version of the Internet Protocol.<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>The output shows that your system has both an IPv6 and an IPv4 address associated with it. These addresses can be used for communication with other devices on a network, with IPv6 being used to support the transition to a more extensive address space as IPv4 addresses become scarcer.<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5728mac\u4e0a\u67e5\u770bip\u5730\u5740\uff0c\u6bd4\u8f83\u65b9\u4fbf\u7684\u547d\u4ee4\u662f ifconfig en0 | grep inet \u8fd9\u6761\u547d\u4ee4\u7684\u89e3\u91ca\u5982\u4e0b Executes the &quot;ifconfig&quot; command to retrieve network configuration information for the &quot;en0&quot; network interface. Pipes (|) the output of the &quot;ifconfig&quot; command to the &quot;grep inet&quot; command. The &quot;grep&quot; command searches through the output and extracts any lines that contain the word &quot;inet.&quot; \u8f93\u51fa\u5982\u4e0b\u56fe \u53e6\u5916\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u67e5\u770bip\u5730\u5740\uff0c\u53ef\u4ee5\u53d1\u73b0\u5728\u5bbf\u4e3b\u673a\u548c\u5bb9\u5668\u91cc\uff0c\u663e\u793a\u7684ip\u5730\u5740\u662f\u76f8\u540c\u7684\u3002 # curl ifconfig.me &hellip; <a href=\"http:\/\/madapapa.com\/wordpress\/?p=619\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">\u5728\u5bbf\u4e3b\u673a\u548c\u5bb9\u5668\u91cc\uff0c\u5206\u522b\u67e5\u770bip\u5730\u5740<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-619","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=619"}],"version-history":[{"count":1,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/619\/revisions"}],"predecessor-version":[{"id":620,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/619\/revisions\/620"}],"wp:attachment":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=619"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}