LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-12-2024, 07:38 AM   #1
mahesh.riddles
LQ Newbie
 
Registered: Feb 2024
Posts: 8

Rep: Reputation: 1
ip address show


Code:
ip address show
Code:
1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
1: lo    inet6 ::1/128 scope host noprefixroute \       valid_lft forever preferred_lft forever
2: enp0s25    inet 192.168.1.102/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s25\       valid_lft 5531sec preferred_lft 5531sec
on internet, i checked my ip address
IPv4: ? 117.205.235.222

Why is it different?
i think 192.168.x.x is a private ip

How do i find my real/public ip address
i am using fedora
 
Old 02-12-2024, 07:48 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by mahesh.riddles View Post
Code:
ip address show
Code:
1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
1: lo    inet6 ::1/128 scope host noprefixroute \       valid_lft forever preferred_lft forever
2: enp0s25    inet 192.168.1.102/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s25\       valid_lft 5531sec preferred_lft 5531sec
on internet, i checked my ip address IPv4: ? 117.205.235.222

Why is it different? i think 192.168.x.x is a private ip How do i find my real/public ip address i am using fedora
Why do you think it's different??? You have one public-facing IP address from your ISP, and the private 192 address is your local machine on your local network.
 
1 members found this post helpful.
Old 02-12-2024, 08:14 AM   #3
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 691
Blog Entries: 1

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
If I understand what you are asking, go here: http://checkip.dyndns.org/

Forgot, this should work also where comcast.net is your Internet provider

Code:
traceroute -m 2 comcast.net

Last edited by jmccue; 02-12-2024 at 08:19 AM.
 
1 members found this post helpful.
Old 02-12-2024, 10:24 AM   #4
mahesh.riddles
LQ Newbie
 
Registered: Feb 2024
Posts: 8

Original Poster
Rep: Reputation: 1
From the link you gave me, the public ip address is : "117.205.235.222"

From traceroute

Code:
1  _gateway (192.168.1.1)  0.416 ms  0.452 ms  0.586 ms
 2  117.205.232.1 (117.205.232.1)  1.533 ms  1.713 ms  2.101 ms
I think it is still different.

Why am i not able to see my public ip address from "ip a" command?
Apart from traceroute, is there any command which can give my public ip?

i am not going to do this on my desktop, just asking...
If i edit /etc/hosts and resolv.conf, then will "ip a" show the public ip?
 
Old 02-12-2024, 10:28 AM   #5
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: Arch Linux && OpenBSD 7.4 && Pop!_OS && Kali && Qubes-Os
Posts: 824

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
Quote:
Originally Posted by mahesh.riddles View Post
How do i find my real/public ip address
i am using fedora
Code:
$ curl ifconfig.me/ip
^that way you can get your ip-address via commandline.
 
1 members found this post helpful.
Old 02-12-2024, 07:59 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,328
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Quote:
Why am i not able to see my public ip address from "ip a" command?
Because your public ip address is in the public-facing side of your router, not on your local machine.

You can find out what it is without logging into your router by going to https://www.whatismyip.com/.
 
1 members found this post helpful.
Old 02-12-2024, 09:07 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,713

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
<internet>-----117.205.232.1<WAN router LAN 192.168.1.1>------<192.168.1.102 PC>

The ip command shows addresses that are assigned to the PC itself.

The router/gateway device has two IP addresses. The WAN or internet side is your public IP address, the LAN side is a private IP address. Your PC address is typically assigned by the router using DHCP which in your case is 192.168.1.102.

The gateway addresses is typically the LAN IP address of your router which in your case is 192.168.1.1
 
2 members found this post helpful.
Old 02-13-2024, 12:31 AM   #8
___
Member
 
Registered: Apr 2023
Posts: 140
Blog Entries: 1

Rep: Reputation: Disabled
https://en.wikipedia.org/wiki/Networ...ss_translation
 
Old 02-13-2024, 03:00 AM   #9
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
my 2 cents:

Internet or let's say Public network >> needs Public IP

Home or Internal network >> only needs Private IP

However, since Private IP is not able to communicate to Internet and the only acceptable IP on the Internet is Public IP
That's where NAT'ing comes into play, to save IPv4 from running out.

To find your public IP as suggested above you can open Terminal and type:

curl ifconfig.me/ip

curl ipinfo.io/ip

wget -qO- https://api.ipify.org



Quote:
Connecting to the internet: Each device connected to the internet needs a unique identifier to communicate with other devices. A public IP address acts as this unique identifier, allowing information to flow in and out of your network.
 
1 members found this post helpful.
Old 02-13-2024, 08:26 AM   #10
mahesh.riddles
LQ Newbie
 
Registered: Feb 2024
Posts: 8

Original Poster
Rep: Reputation: 1
Thanks a lot friends. I understood the concept and understood how silly my question was now! :-)
 
1 members found this post helpful.
Old 02-14-2024, 11:53 PM   #11
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Quote:
Originally Posted by mahesh.riddles View Post
Thanks a lot friends. I understood the concept and understood how silly my question was now! :-)
Don't feel bad, if you will never ask you will never know...At least you got a question others don't even know how to formulate their own questions.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
df and due commands show differences and lsof does not show deleted files devUnix Linux - Server 7 07-17-2014 03:45 PM
gtkmm: show() doesn't show the window when adding windows from other places than main() Hvl Programming 0 06-21-2012 09:54 AM
Pictures show on camera but wont show on laptop ravio Linux - Newbie 3 05-28-2012 11:20 PM
Evolution does not show content of inbox or sent but does show other folders manny_borges Linux - Newbie 1 05-07-2011 05:08 PM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration