Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How do you know your public IP terminal in Linux     - Java JDK has been able to compile without warning (Programming)

- Ubuntu install Geary (Linux)

- crontab task scheduling Health Check (Linux)

- Linux operation and maintenance of the automated installation and deployment RHEL7.0 Cobbler (Linux)

- Ubuntu 14.04.1 LTS compile and install the new kernel (Linux)

- Lua4.0 interpreter documents (Programming)

- Setting the RedHat9 Intrusion Detection System (Linux)

- VMware virtual machine to use bridged mode fast Internet access (Linux)

- Protection Docker container Notice (Server)

- Linux basis: a comprehensive study pwd command (Linux)

- MySQL to NoSQL avatar (Database)

- Installation and use of Linux Sniffer tool Tcpdump (Linux)

- Linux environment password security settings (Linux)

- Hadoop 2.6.0 standalone configuration and pseudo-distributed configuration under Ubuntu 14.04 (Server)

- CentOS / Linux kernel upgrade (Linux)

- MySQL Slave synchronization problem solving (Database)

- Using C ++ Container Templates in Shared Memory (Programming)

- To create a full command line Android Build System (Linux)

- Zookeeper cluster deployment (Server)

- Squid proxy server (Server)

  How do you know your public IP terminal in Linux
  Add Date : 2018-11-21      
  Public address assigned by the InterNIC by class-based network ID or address blocks CIDR-based configuration (called CIDR blocks), and to ensure the uniqueness of the global Internet. When the public address is assigned, its route will be recorded to the Internet router, so you can access public address traffic smooth arrival. Traffic access to the target public address can be reached via the Internet. For example, when a CIDR blocks are allocated in the form of a network ID and subnet mask to an organization, the corresponding [network ID, subnet mask] will also be stored as a route in the Internet router. Goal is CIDR block IP address of the packet will be guided to the corresponding position.

In this article I will explain in a few check your public IP address in Linux terminal method. It makes no sense for the average user, but Linux server (no GUI or as a basic tool can only be used when the user logs on) would be useful. In any case, access to public IP is very significance in various aspects from the Linux terminal, we might be able to need it some day.

Here are two of our main command used, curl and wget. You can change the use.


Curl plain text output:

curl icanhazip.com
curl ifconfig.me
curl curlmyip.com
curl ip.appspot.com
curl ipinfo.io/ip
curl ipecho.net/plain
curl www.trackip.net/i

curl JSON output format:

curl ipinfo.io/json
curl ifconfig.me/all.json
curl www.trackip.net/ip?json (somewhat ugly)

curl XML output format:

curl ifconfig.me/all.xml

curl get all IP details (excavator)

curl ifconfig.me/all

Use DYDNS (useful when you use DYDNS Service)

curl -s 'http: //checkip.dyndns.org' | sed 's /.* Current IP Address: \ ([0-9 \.] * \) * / \ 1 / g.'
curl -s http://checkip.dyndns.org/ | grep -o "[. [: digit:]] \ +"

Instead of using Wget Curl

wget http://ipecho.net/plain -O - -q; echo
wget http://observebox.com/ip -O - -q; echo

Host and dig using the command

If so, you can use the dig command and host.

host -t a dartsclink.com | sed 's /.* has address //'
dig + short myip.opendns.com @ resolver1.opendns.com

bash script example:

#! / Bin / bash
PUBLIC_IP = `wget http://ipecho.net/plain -O - -q; echo`
echo $ PUBLIC_IP
Easy to use.

I'm actually writing a daily record for my router, all IP changes and save it to a script file. I found a good use of these commands in the search process. I hope that one day it can help other people.
- How to recover deleted files in Linux systems (Linux)
- To remove those IP is prohibited Fail2ban on CentOS 6/7 (Server)
- Java Foundation - implicit conversion vs cast (Programming)
- Go performed using iOS and Android programming (Programming)
- GAMIT10.5 under CentOS installation (Linux)
- Using the Linux folder wc statistics number of lines of code for all files (including subdirectories) (Linux)
- Job achieve automation in Ubuntu 14.04 - Using Cron (Linux)
- Oracle 11g creates virtual private directory RMAN-06004 ORA-00942 error handling (Database)
- How to remove the Linux memory Cache, Buffer and swap space (Linux)
- The Oracle VM VirtualBox use U disk under ubuntu (Linux)
- ARM Linux system call (Linux)
- SUSE Linux network configuration and firewall configuration (Linux)
- Commonly used Linux system camouflage method (Linux)
- Android Delete project useless resource file (Programming)
- Node.js v4.0.0 installation configuration on Ubuntu 14.04 / 15.04 (Linux)
- phpinfo (): like phpinfo as a Python script (Programming)
- Hackers is how the invasion and control of Things devices? (Linux)
- MySQL5.7 implement virtual column expression index (Database)
- VMware virtual machine can not start VMnet0 no Internet access and other issues (Linux)
- Linux Firewall IPCop Profile (Linux)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.