Linux Cloud host gets the native public IP address

Source: Internet
Author: User
Tags curl

Because the company's cloud host use ifconfig and IP add command can only see the intranet IP address, and the script also need to get the public IP address for some action;

# ip ad1: lo: <loopback,up,lower_up> mtu 16436 qdisc noqueue  state UNKNOWN     link/loopback 00:00:00:00:00:00 brd  00:00:00:00:00:00    inet 127.0.0.1/8 scope host lo     inet6 ::1/128 scope host        valid_lft  Forever preferred_lft forever2: eth2: <broadcast,multicast,up,lower_up> mtu  1500 qdisc pfifo_fast state up qlen 1000    link/ether  08:00:27:d9:18:4e brd ff:ff:ff:ff:ff:ff    inet 192.168.1.191/24  brd 192.168.1.255 scope global eth2    inet6 fe80::a00:27ff :fed9:184e/64 scope link        valid_lft forever  Preferred_lft forever

There is no public network IP, know what to see the intranet IP address, you can get the public IP address via Curl ip.cip.cc

# Curl IP.CIP.CC183.XX.XX.XX


This article is from the "obsessed" blog, make sure to keep this source http://dragondragon.blog.51cto.com/6170889/1931615

Linux Cloud host gets the native public IP address

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.