¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 715°Ç
   
Å͹̳ο¡¼­ Public IP(°øÀξÆÀÌÇÇ) ã´Â¹æ¹ý
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2016-09-28 (¼ö) 09:45 Á¶È¸ : 2291
                                
1. dig 
# dig +short myip.opendns.com @resolver1.opendns.com
XXX.XXX.208.36

# dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
"XXX.XXX.208.36"
   +[no]short          (Display nothing except short form of answer)

# host myip.opendns.com resolver1.opendns.com
Using domain server:
Name: resolver1.opendns.com
Address: 208.67.222.222#53
Aliases: 

myip.opendns.com has address XXX.XXX.208.36
Host myip.opendns.com not found: 3(NXDOMAIN)
Host myip.opendns.com not found: 3(NXDOMAIN)


2. curl
#  curl ipecho.net/plain; echo
XXX.XXX.208.36

# curl icanhazip.com
XXX.XXX.208.36

# curl ifconfig.co
XXX.XXX.208.36


3 wget 
# wget -qO- http://ipecho.net/plain ; echo
XXX.XXX.208.36
¡Ø-O,  --output-document=FILE    write documents to FILE.
   -q : --quite  Turn off Wget's output.


4. lynx 
# lynx -dump checkip.dyndns.org
   Current IP Address: XXX.XXX.208.36


5 Bash script
À§¿¡¼­ ¾ð±ÞÇß´ø ³×°¡Áö ¹æ¹ýÀ» bash ½ºÅ©¸³Æ®È­Çؼ­.....
# cat find_publicip.sh 
MY_IP="$(dig +short myip.opendns.com @resolver1.opendns.com)"
echo "My OpenStack / Public IP address: ${MY_IP}"

# sh find_publicip.sh 
My OpenStack / Public IP address: XXX.XXX.208.36


6. ¸ÞŸµ¥ÀÌŸ Á¤º¸ ÀÌ¿ë
# curl http://169.254.169.254/latest/meta-data
ami-id
ami-launch-index
ami-manifest-path
block-device-mapping/
hostname
instance-action
instance-id
instance-type
local-hostname
local-ipv4
placement/
public-hostname
public-ipv4
reservation-id

# curl http://169.254.169.254/latest/meta-data/public-ipv4; echo
XXX.XXX.208.36

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.