{"id":967,"date":"2025-03-03T15:01:06","date_gmt":"2025-03-03T06:01:06","guid":{"rendered":"https:\/\/txn.myds.me\/blog\/?p=967"},"modified":"2025-03-03T15:01:06","modified_gmt":"2025-03-03T06:01:06","slug":"%e8%87%aa%e3%83%9b%e3%82%b9%e3%83%88%e3%81%ae%e5%a4%96%e5%81%b4%e3%81%ae-ip-%e3%82%a2%e3%83%89%e3%83%ac%e3%82%b9%e3%82%92-curl-%e3%81%a7%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"https:\/\/blog.txn.red\/?p=967","title":{"rendered":"\u81ea\u30db\u30b9\u30c8\u306e\u5916\u5074\u306e IP \u30a2\u30c9\u30ec\u30b9\u3092 curl \u3067\u53d6\u5f97\u3059\u308b\u3002"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">IP \u30a2\u30c9\u30ec\u30b9\u3067\u30a2\u30af\u30bb\u30b9\u5236\u9650\u3059\uff46\u308b\u5834\u5408\u306b\u81ea\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u5916\u5074\u304b\u3089\u307f\u305f IP \u30a2\u30c9\u30ec\u30b9\u3092\u8abf\u3079\u305f\u3044\u5834\u5408\u304c\u3042\u308b\u3002\u5916\u90e8\u306e API \u30b5\u30fc\u30d0\u30fc\u3084 Web \u30b5\u30fc\u30d0\u30fc\u304c\u63a5\u7d9a\u5143\u306e IP \u30a2\u30c9\u30ec\u30b9\u3067\u5236\u9650\u3059\u308b\u3088\u3046\u306a\u5834\u5408\u3060\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30ed\u30fc\u30ab\u30eb\u306e\u30eb\u30fc\u30bf\u30fc\u306b\u5165\u308c\u3070\u78ba\u8a8d\u3059\u308b\u3053\u3068\u306f\u5f53\u7136\u306b\u3067\u304d\u308b\u304c\u307e\u3042\u9762\u5012\u3067\u3059\u3002curl \u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u81ea\u30cd\u30c3\u30c8\u306e IP \u30a2\u30c9\u30ec\u30b9\u3092\u8fd4\u3057\u3066\u304f\u308c\u308b\u30b5\u30a4\u30c8\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u524d\u304b\u3089 ipinfo.io \u306f\u77e5\u3063\u3066\u307e\u3057\u305f\u304c\u3053\u306e\u30b5\u30a4\u30c8\u3060\u3068 IPv4 \u3057\u304b\u8fd4\u3057\u3066\u304f\u308c\u307e\u305b\u3093\u3002(\u6050\u3089\u304f IPv4 \u3067\u3057\u304b\u63a5\u7d9a\u3092\u53d7\u3051\u4ed8\u3051\u3066\u304f\u308c\u306a\u3044\u306e\u3067\u3057\u3087\u3046\u3002)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Claude \u306b &#8220;curl \u3067\u81ea\u30db\u30b9\u30c8\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u78ba\u8a8d\u3067\u304d\u308b\u30b5\u30a4\u30c8\u3092\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3057\u3066&#8221; \u3068\u805e\u3044\u3066\u307f\u308b\u3068\u4ee5\u4e0b\u306e\u56de\u7b54\u3092\u8fd4\u3057\u3066\u304f\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">IP \u30a2\u30c9\u30ec\u30b9\u3092\u78ba\u8a8d\u3067\u304d\u308b\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u306b\u5bfe\u3057\u3066\u3001curl \u30b3\u30de\u30f3\u30c9\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3082\u306e\u3092\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u3067\u306f\u5916\u90e8\u304b\u3089\u898b\u305f\u3042\u306a\u305f\u306e IP \u30a2\u30c9\u30ec\u30b9\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\uff1a\n\n1. `curl ifconfig.me`\n2. `curl ipinfo.io\/ip`\n3. `curl api.ipify.org`\n4. `curl checkip.amazonaws.com`\n5. `curl icanhazip.com`\n6. `curl ipecho.net\/plain`\n7. `curl ip.tyk.nu`\n8. `curl wtfismyip.com\/text`\n9. `curl ipaddress.sh`\n10. `curl myip.dnsomatic.com`\n\n\u3053\u308c\u3089\u306e\u30b5\u30a4\u30c8\u306f\u30d7\u30ec\u30fc\u30f3\u30c6\u30ad\u30b9\u30c8\u3067 IP \u30a2\u30c9\u30ec\u30b9\u3060\u3051\u3092\u8fd4\u3059\u305f\u3081\u3001curl \u30b3\u30de\u30f3\u30c9\u3068\u76f8\u6027\u304c\u826f\u3044\u3067\u3059\u3002\u8ffd\u52a0\u60c5\u5831\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u3001\u4f8b\u3048\u3070 `curl ipinfo.io` \u306e\u3088\u3046\u306b\u3059\u308b\u3068\u3001IP \u30a2\u30c9\u30ec\u30b9\u3060\u3051\u3067\u306a\u304f\u5730\u7406\u7684\u306a\u4f4d\u7f6e\u60c5\u5831\u306a\u3069\u3082\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3072\u3068\u3064\u3065\u3064\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u3001IPv6 \u3068 IPv4 \u3092\u8fd4\u3059\u30b5\u30a4\u30c8\u304c\u534a\u3005\u304f\u3089\u3044\u3067\u3057\u305f\u300110 \u306f\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3067\u3001\u81ea\u5206\u306b\u306f\u3053\u308c\u3089\u306e\u30b5\u30a4\u30c8\u540d\u306f\u3061\u3087\u3063\u3068\u899a\u3048\u306b\u304f\u304b\u3063\u305f\u306e\u3067 IPv6 \u3068 IPv4 \u3092\u4e21\u65b9\u3068\u3082\u8868\u793a\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-file=\"get-outside-ip.sh\" data-lang=\"Bash\"><code># get outside IP address. this script gets IPv6 and IPv4 address both.\n\n#!\/bin\/bash\n\n# for IPv6\necho -n &quot;IPv6: &quot;\n\n# \u51fa\u529b\u306b\u6539\u884c\u304c\u306a\u3044\u30d1\u30bf\u30fc\u30f3\ncurl ipecho.net\/plain\n# curl ipecho.net\/plain\n# curl ip.tyk.nu\necho &quot;&quot;\n\n# \u51fa\u529b\u306b\u6539\u884c\u306e\u3042\u308b\u30d1\u30bf\u30fc\u30f3\n# curl wtfismyip.com\/text\n# curl ifconfig.me\n# curl icanhazip.com\n# curl wtfismyip.com\/text\n\n# for IPv4\necho -n &quot;IPv4: &quot;\ncurl ipinfo.io\/ip\n#curl api.ipify.org\necho &quot;&quot;\n\n# \u51fa\u529b\u306b\u6539\u884c\u306e\u3042\u308b\u30d1\u30bf\u30fc\u30f3\n# curl checkip.amazonaws.com\n# curl ipaddress.sh<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>IP \u30a2\u30c9\u30ec\u30b9\u3067\u30a2\u30af\u30bb\u30b9\u5236\u9650\u3059\uff46\u308b\u5834\u5408\u306b\u81ea\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u5916\u5074\u304b\u3089\u307f\u305f IP \u30a2\u30c9\u30ec\u30b9\u3092\u8abf\u3079\u305f\u3044\u5834\u5408\u304c\u3042\u308b\u3002\u5916\u90e8\u306e API \u30b5\u30fc\u30d0\u30fc\u3084 Web \u30b5\u30fc\u30d0\u30fc\u304c\u63a5\u7d9a\u5143\u306e IP \u30a2\u30c9\u30ec\u30b9\u3067\u5236\u9650\u3059\u308b\u3088\u3046\u306a\u5834\u5408\u3060\u3002 \u30ed\u30fc\u30ab\u30eb\u306e\u30eb\u30fc\u30bf\u30fc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":9,"footnotes":""},"categories":[5],"tags":[8],"class_list":["post-967","post","type-post","status-publish","format-standard","hentry","category-it","tag-linux"],"_links":{"self":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts\/967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=967"}],"version-history":[{"count":0,"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts\/967\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}