Obtain Internet ip addresses in Linux

Source: Internet
Author: User
Linux get Internet ip Method 1: curl-s & quot; http://checkip.dyndns.org/&quot; | cut-f6-d & quot; | cut-f1-d & quot; & lt; & quot; www.2cto.com Method 2: w3m-dumphttp: // submit.apnic.net/templat Linux get Internet ip Method 1: curl-s "http://checkip.dyndns.org/" | cut-f 6-d "" | cut-f 1-d "<" www.2cto.com Method 2: w3m-dump http://submit.apnic.net/templates/yourip.html | grep-P-O' (\ d + \.) {3} \ d + 'method 3: curl ifconfig. me method 4: curl icanhazip.com method 5: curl-s Www.123cha.com | grep-o "[0-9] \ {1, 3 \}\. [0-9] \ {1, 3 \}\. [0-9] \ {1, 3 \}\. [0-9] \ {1, 3 \} "| head-n 1 add them. bashrc (for Bash) or. in profile (not for Bash), go to alias myip = 'curl ifconfig. me 'source. bashrc or .. profile to take effect, enter myip to get the wan ip.
Related Article

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.