因为种种缘由,公司内部使用的服务器须要和云主机发生关系。。。web
因此就须要知道内网服务器的出口公网地址服务器
以前被这个事困扰过,前几天想起来因而解决了下,简单记录下几种方法curl
curl icanhazip.com curl ifconfig.me curl ipinfo.io/ip
cur是一个命令行工具,用来请求web服务器,是一个利用URL语法在命令行下工做的文件传输工具ide
DESCRIPTION curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.