Open In App
Related Articles

Know your public and private IP addresses

Improve Article
Improve
Save Article
Save
Like Article
Like

You might have used ifconfig command on your linux terminal to know different network configurations of your system. 

ifconfig command shows hardware address(HWaddr) and network address(inet addr) for Ethernet or your wifi connection. 

ifconfig command don’t show your public IP address(if public and private are different). For that purpose, you can simply type in google search : what is my ip address, it will show your public IP address. 

On linux terminal, you can use following commands to know your IP addresses: 

Public IP :

curl ifconfig.me
      or 
curl ipinfo.io/ip

Private IP :

hostname -I

References : 

linux man entry for ifconfig 

know your public IP askubuntu

Unlock the Power of Placement Preparation!
Feeling lost in OS, DBMS, CN, SQL, and DSA chaos? Our Complete Interview Preparation Course is the ultimate guide to conquer placements. Trusted by over 100,000+ geeks, this course is your roadmap to interview triumph.
Ready to dive in? Explore our Free Demo Content and join our Complete Interview Preparation course.

Last Updated : 15 Jun, 2022
Like Article
Save Article
Previous
Next
Similar Reads