Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ How do you know your public IP terminal in Linux     - Hadoop2.4.0 Eclipse plug-in making (Server)

- Automatic Clear date directory shell script (Linux)

- Linux Routine Task Scheduler (Linux)

- Ubuntu install VMware Workstation 11 tutorials at 14.04 / 14.10 (Linux)

- Install Rubinius testing Ubuntu 14.04 native threads (Linux)

- C # mobile side and PC-side data exchange (Database)

- VMware difference in three network connection (Linux)

- After CentOS configure SSH password Free, still prompted for a password (Linux)

- IOwait Linux system monitoring diagnostic tools (Linux)

- Eclipse remove all comments and code spaces (Linux)

- Android components save state series - Activity (Programming)

- SQLite database commonly used sentences and visualization tools on MAC MeasSQLlite use (Database)

- Vim copy and paste register (Linux)

- Mount NFS network file system (Linux)

- Sniffer Linux Environment (Linux)

- Linux security settings Basics (Linux)

- CentOS 6.5 start ActiveMQ being given to solve (Server)

- Machine Learning: Classification of the curse of dimensionality (Programming)

- The bulk batch multiple rows of data collect (Database)

- Linux Mint 17 set up the Ruby environment (Linux)

 
         
  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:      
 
- Use this one-time password via SSH secure login Linux (Programming)
- Linux formatted partition error Could not stat / dev / sda No such file or directory Solution (Linux)
- Gentoo: existing preserved libs problem solving (Linux)
- Ubuntu install Tonido private cloud services (Server)
- linux server security (Linux)
- CentOS 6.5 upgrade to CentOS 7 (Linux)
- OpenNMS compile under Linux (Server)
- GRUB how to load Linux kernel (Linux)
- C language preprocessor command (Programming)
- The principle Httpclient4.4 (execution request) (Programming)
- Oracle Automatic Diagnostic Repository (Automatic Diagnostic Repository, ADR) (Database)
- Chrome plug-in management, online-offline installation, part of the plug presentations (Linux)
- Network traffic monitoring ntopng (Linux)
- Oracle 11g to create a second instance on Linux (Database)
- File permissions under Linux (Linux)
- Golang use Oracle database on Ubuntu 14.04 (Linux)
- JavaScript function part (Programming)
- SYN attack hacker attack and defense of the basic principles and prevention technology (Linux)
- How to choose the correct HTTP status code (Server)
- DVD production using CentOS installation source within the company Yum (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.