Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 如何在DigitalOcean上查找您的私人IP地址?_Node.js_Ubuntu_Ubuntu 14.04_Digital Ocean - Fatal编程技术网

Node.js 如何在DigitalOcean上查找您的私人IP地址?

Node.js 如何在DigitalOcean上查找您的私人IP地址?,node.js,ubuntu,ubuntu-14.04,digital-ocean,Node.js,Ubuntu,Ubuntu 14.04,Digital Ocean,我在做关于如何在虚拟服务器中设置node.js应用程序的教程,问题是,我无法获得我的私有ip地址 是配置问题还是我在数字海洋中的液滴问题 到目前为止,我正在使用ssh连接、安装fail2ban和配置iptable curl -w "\n" http://myipAddress/metadata/v1/interfaces/private/0/ipv4/address <html> <head><title>404 Not Found</title>

我在做关于如何在虚拟服务器中设置node.js应用程序的教程,问题是,我无法获得我的私有ip地址

是配置问题还是我在数字海洋中的液滴问题

到目前为止,我正在使用ssh连接、安装fail2ban和配置iptable

curl -w "\n" http://myipAddress/metadata/v1/interfaces/private/0/ipv4/address
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.4.6 (Ubuntu)</center>
</body>
</html>

看起来您正试图使用查找您的专用IP地址。要访问它,您需要查询元数据服务的IP,而不是您的公共IP。因此,正确的命令是:

curl -w "\n" http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/address
专用接口被指定为
eth1
,因此您还可以通过以下方式找到其IP地址:

ifconfig eth1
也可在水滴设置页面的DigitalOcean控制面板中找到:

ifconfig eth1