现在的位置: 首页 > 综合 > 正文

Amazon EC2 取得自己的外部IP和域名

2014年10月17日 ⁄ 综合 ⁄ 共 337字 ⁄ 字号 评论关闭

保存到临时文件

wget -q -O /tmp/public-ip http://169.254.169.254/latest/meta-data/public-ipv4
wget -q -O /tmp/public-hostname http://169.254.169.254/latest/meta-data/public-hostname

 

直接查看

curl http://169.254.169.254/latest/meta-data/local-ipv4

 

curl http://169.254.169.254/latest/meta-data/public-ipv4

curl http://169.254.169.254/latest/meta-data/public-hostname

抱歉!评论已关闭.