Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How do you know your public IP terminal in Linux     - To explore the caching mechanism for Android ListView (Programming)

- MySQL optimization resulting order by using filesort (Database)

- Shell command line operation (Linux)

- How to compare PDF files on Ubuntu (Linux)

- Implement binary search algorithm in C language (Programming)

- Getting Started with Linux system to learn: how to check the version of SSH on Linux (Linux)

- RT-11SJ run at ambient PDP-11 MACRO-11 assembly (Programming)

- Java synchronization mechanism used in locking Thought (Programming)

- Oracle to start to solve the error ORA-27102 (Database)

- rpm package specify the installation path (Linux)

- GAMIT 10.50 installed in Ubuntu 12.04 system (Linux)

- Python exception summary (Programming)

- Linux Hard Disk Partition and file system management (Linux)

- Remove old kernel on Ubuntu (Linux)

- Ubuntu system cp: omitting directory problem (Linux)

- The difference between vi and nano (Linux)

- MySQL use benchmarking tool sysbench (Database)

- Linux LVM space expansion Demo (Linux)

- C ++ copy constructor (Programming)

- Automate deployment of Docker-based Rails applications (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.
- Create a project using Android Studio LinearLayout (Programming)
- MySQL Study of --Percona Server 5.5 Upgrade 5.6 (Database)
- Manually generate AWR reports (Database)
- Linux netstat command to get started (Linux)
- How to contribute code on GitHub uploads (Linux)
- Linux commands with browsing and downloading files (Linux)
- Ruby and Python simple comparison (Programming)
- quotacheck command file can not be created aquota.user and aquota.group solutions (Linux)
- Linux iptables firewall and vsftpd to resolve the issue (Linux)
- Git uses a small mind (Linux)
- Stunning exclamation point at the Linux command line (Linux)
- Qt for file splitting and fusion gadgets (Programming)
- Linux the best download manager uGet (Linux)
- VMware Workstation virtual machine cloning (Linux)
- Nginx introduced Dynamic Module Architecture (Server)
- HttpClient4 usage upgrade from HttpClient3 (Programming)
- CentOS card fails to start at boot progress bar certmonger solve (Linux)
- Linux System Getting Started Learning: compile and install ixgbe driver in Ubuntu or Debian (Linux)
- Improve the efficiency of Linux development tools 5 (Linux)
- Ubuntu 14.04 installed NVIDIA graphics driver (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.