\u4e00\u822c\u800c\u8a00\uff0c\u4e3b\u6a5f\u5546\u7684\u4e3b\u6a5f\uff0c\u4e0d\u6703\u53ea\u6709\u4e00\u500bIP\u4f4d\u7f6e\u3002\u901a\u5e38\u6703\u6709\u8d85\u904e\u4e00\u500b\uff0c\u4ee5\u5099\u4e0d\u6642\u4e4b\u9700\u3002\u7136\u800c\uff0c\u7531\u65bc\u7db2\u8def\u4e0a\u7684\u6709\u4e9b\u670d\u52d9\uff0c\u5e38\u6703\u9396IP\uff0c\u6240\u4ee5\u900f\u904ephp\u53bb\u5b58\u53d6\u9060\u7aef\u7684\u7db2\u7ad9\u6642\uff0c\u6709\u6642\u5019\u5c31\u5fc5\u9808\u8003\u616e\u9019\u500b\u5c0d\u5916\u9023\u7dda\u4f7f\u7528\u7684IP\u4f4d\u7f6e\u3002<\/p>\n
\u4f7f\u7528ifconfig\u6307\u4ee4\uff0c\u901a\u5e38eth0\u4e0a\u9644\u52a0\u7684\u9019\u500bip\u5c31\u662f\u9810\u8a2d\u7684\u5c0d\u5916\u9023\u7dda\u7528IP(outgoing IP address)\u3002\u7531\u65bc\u4f7f\u7528\u8005\u767b\u5165\u4e3b\u6a5f\u6642\uff0c\u662f\u4e00\u822cuser\uff0c\u7121\u6cd5\u4f7f\u7528ifconfig\u3002\u6240\u4ee5\u8981\u7528\u5176\u5b83\u65b9\u6cd5\u4f86\u5224\u65b7\u3002\u5176\u4e2d\u4e00\u7a2e\u65b9\u5f0f\u662fcurl\u3002\u4e0b\u9762\u9019\u500b\u6307\u4ee4\u5c31\u53ef\u4ee5\u5f97\u5230\u7cfb\u7d71\u9810\u8a2d\u5c0d\u5916\u4e3b\u52d5\u9023\u7dda\u6642\u6240\u4f7f\u7528\u7684IP\u4e86\u3002<\/p>\n
curl -s ip.appspot.com<\/p>\n
\u800c\uff0c\u5982\u679c\u5c0d\u5916\u662f\u900f\u904ephp\u53bb\u5b58\u53d6\u9060\u7aef\u7684\u8cc7\u6599\uff0c\u53c8\u5fc5\u9808\u6307\u5b9aphp\u4e00\u5b9a\u8981\u900f\u904e\u67d0\u500b\u7db2\u8def\u4ecb\u9762\/IP address\u4f86\u9023\u7dda\u7684\u8a71\uff0c\u53ef\u4ee5\u8003\u616e\u4f7f\u7528php curl library\u3002\u7bc4\u4f8b\u7684code\u5982\u4e0b\uff1a<\/p>\n
<? echo $result; \u5176\u4e2d\uff0c”888.888.888.888″\uff0c\u5c31\u662f\u8981\u88ab\u6307\u5b9a\u7528\u5c0d\u5916\u9023\u7dda\u7528\u7684IP\u4f4d\u7f6e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u4e00\u822c\u800c\u8a00\uff0c\u4e3b\u6a5f\u5546\u7684\u4e3b\u6a5f\uff0c\u4e0d\u6703\u53ea\u6709\u4e00\u500bIP\u4f4d\u7f6e\u3002\u901a\u5e38\u6703\u6709\u8d85\u904e\u4e00\u500b\uff0c\u4ee5\u5099\u4e0d\u6642\u4e4b\u9700\u3002\u7136\u800c\uff0c\u7531\u65bc\u7db2\u8def\u4e0a\u7684\u6709\u4e9b\u670d\u52d9\uff0c\u5e38\u6703 … \u95b1\u8b80\u5168\u6587 php\u6307\u5b9a\u5c0d\u5916\u9023\u7dda\u4f7f\u7528\u7684IP\u4f4d\u7f6e<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[3],"tags":[39,40,8],"_links":{"self":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/156"}],"collection":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/comments?post=156"}],"version-history":[{"count":2,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":651,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/156\/revisions\/651"}],"wp:attachment":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/media?parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/categories?post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/tags?post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\n$url = “http:\/\/www.google.com”
\n$curlh = curl_init($url);
\ncurl_setopt($curlh, CURLOPT_USERAGENT, $uagent);
\ncurl_setopt($curlh, CURLOPT_INTERFACE, “888.888.888.888<\/span>“);
\ncurl_setopt($curlh, CURLOPT_RETURNTRANSFER, true);
\n$result = curl_exec($curlh);<\/p>\n
\n?><\/p>\n