Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ How do you know your public IP terminal in Linux     - Using IntelliJ IDEA Import Spark Spark latest source code and compile the source code (Linux)

- Ubuntu 14.04 How to install Cinnamon 2.4.5 (Linux)

- Ubuntu 15.04 install Complete Guide (Linux)

- systemd-nspawn Quick Guide (Linux)

- Terminal Linux command prints - echo (Linux)

- Teach you the Ubuntu Server enabled SSH multifactor authentication (Server)

- Ubuntu the ARP (arptables) (Linux)

- Ubuntu install Lighttpd + Mono support .net (Linux)

- Build ftp server under CentOS 6.5 (Server)

- Linux Network Programming - libnet Guide (Programming)

- CentOS / RHEL 6 was repeated prohibited under the SNMP connection log (Server)

- Oracle 11g 10g induced into error (Database)

- Install Java 8 on Ubuntu using PPA (Linux)

- Linux mention the right notes (Linux)

- linux network security experience (Linux)

- How do you know your public IP terminal in Linux (Linux)

- Hadoop 2.2.0 installation development environment (standalone pseudo-distributed mode) (Server)

- Java in the final qualifier (Programming)

- The callback function used in C ++ (Programming)

- [Android] Eclipse does not update the Android SDK Manager solution [using GoAgent] (Programming)

 
         
  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.
     
         
       
         
  More:      
 
- Linux system security check notes on performance (Linux)
- independently configurable PHP environment under CentOS6.5 (Server)
- CentOS 6 adds disk quota limit (Linux)
- hadoop 2.7.1 High Availability Setup Deployment (Server)
- Oracle GoldenGate tutorial Second, configure and use (Database)
- Linux environment has been running Tomcat how to deploy the new Tomcat (Server)
- Heartbeat cluster components Overview (Server)
- Ease of use "Explain Shell" script to understand Shell command (Linux)
- Configuration OpenOCD + FT2232 under Ubuntu (Linux)
- Autojump: an advanced cd command in the Linux file system fast navigation (Linux)
- Linux Tutorial Share: How to sudo command to define the PATH environment variable (Linux)
- Oracle study notes view (Database)
- Linux RAID Set RAID 10 or 0 + 1 (Linux)
- Manual cleaning Oracle audit records (Database)
- Linux server security - the web server configuration (Linux)
- Use Swift remove the spaces in the string (Programming)
- Linux firewall anti-hacker disguise malicious attacks (Linux)
- Fast Sort Algorithms (Programming)
- Linux disk quota-related instruction (Linux)
- Subsequent binary search tree traversal sequence (Programming)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.