LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-14-2008, 06:01 AM   #1
Eric Ruhumuliza
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
How can I find my Internet Protocol Address


I just want to see my Internet Protocol address
 
Old 10-14-2008, 06:08 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Either run (for information on all ethernet devices)
Code:
ifconfig
or (for information on specific ethernet device, in this case eth0)
Code:
ifconfig eth0
and you'll see your IP and other information, if you have a direct connection to the internet (i.e. not trough Local Area Network). If you are inside a LAN, you'll only see your LAN IP address, in which case it's probably easier to just visit a site like whatismyip.com which will happily tell you your external IP.

Welcome to LQ!
 
Old 10-14-2008, 08:32 AM   #3
Vit77
Member
 
Registered: Jun 2008
Location: Toronto, Canada
Distribution: SuSE, RHEL, Mageia
Posts: 132

Rep: Reputation: 17
Almost the same result, but in "new" style.

Code:
ip addr show
 
Old 10-14-2008, 09:27 AM   #4
harry2006
Member
 
Registered: Aug 2006
Location: /hawaii/honolulu/downtown
Distribution: Fedora 10[Cambridge] and Ubuntu 9.04[Jaunty]
Posts: 201

Rep: Reputation: 30
Quote:
Originally Posted by Vit77 View Post
Almost the same result, but in "new" style.

Code:
ip addr show
what is this? never heard of this?
 
Old 10-14-2008, 09:49 AM   #5
Vit77
Member
 
Registered: Jun 2008
Location: Toronto, Canada
Distribution: SuSE, RHEL, Mageia
Posts: 132

Rep: Reputation: 17
Quote:
Originally Posted by harry2006 View Post
what is this? never heard of this?
It's sort of new utility with some new possibilities.
In general, it could work as a replacement for a majority of different Unix network commands.

It allows to operate with IP addresses and aliases, routes, etc.
Understands short abbreviations of commands, such as
Code:
ip addr show = ip ad sh
ip route = ip ro
etc.

Some examples.
Code:
ip addr add 10.0.0.10/16 dev eth0
ip link set eth0 up
ip route add 20.0.0.0/8 via 10.0.0.1
ip link show
ip addr show

---

Using aliases:
ip ad ad 10.0.0.1/24 dev eth0
ip ad ad 20.10.1.1/16 dev eth0
ip li set eth0 up
It's easier to type such short commands.
I think it's quite good replacement for old Unix network commands.

Edit:
I forget about the main command:
Code:
ip help
ip command help
etc.

Last edited by Vit77; 10-14-2008 at 09:55 AM.
 
Old 10-14-2008, 10:18 AM   #6
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Of course, the OP probably wants his external address.

Getting that from the command line is a little tricky. I've seen it demonstrated, but can't remember how. One could of course look at the main Router Page in a browser, but for most non-technical people, looking at one of the 40 gazillion web pages that display it is probably the easiest.

WhatIsMyIPAddress.com might work.

Edit: Oops, sorry! B0uncer already said that.

Last edited by rickh; 10-14-2008 at 10:23 AM.
 
Old 10-14-2008, 02:15 PM   #7
ritam_bkp
Member
 
Registered: Sep 2008
Location: Calcutta,India
Distribution: Fedora 11, OpenSUSE 11.0
Posts: 116

Rep: Reputation: 17
Quote:
Originally Posted by Vit77 View Post
Almost the same result, but in "new" style.

Code:
ip addr show

this "ip" command does not work 4 me??
 
Old 10-14-2008, 02:17 PM   #8
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 43
If he's trying to get his external IP from the command line he can use wget:


wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
 
Old 10-14-2008, 03:37 PM   #9
loperz7
Member
 
Registered: Sep 2008
Posts: 53

Rep: Reputation: 15
http://www.ipchicken.com/

Gentoo

Last edited by loperz7; 10-23-2008 at 03:59 AM.
 
Old 10-14-2008, 04:57 PM   #10
paperbag
Member
 
Registered: Dec 2007
Location: London
Distribution: Slackware
Posts: 53

Rep: Reputation: Disabled
Quote:
Originally Posted by ncsuapex View Post
If he's trying to get his external IP from the command line he can use wget:


wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
and i thought this section was for newbies o.O
 
Old 10-14-2008, 04:59 PM   #11
Total-MAdMaN
Member
 
Registered: May 2008
Distribution: Gentoo
Posts: 306

Rep: Reputation: 34
Quote:
Originally Posted by paperbag View Post
and i thought this section was for newbies
It's for newbies to ask questions. More experienced users will answer them. Depending on the question, the answer may be simple or complex (or both).
 
Old 10-14-2008, 09:11 PM   #12
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,832
Blog Entries: 27

Rep: Reputation: 2131Reputation: 2131Reputation: 2131Reputation: 2131Reputation: 2131Reputation: 2131Reputation: 2131Reputation: 2131Reputation: 2131Reputation: 2131Reputation: 2131
Hi,
Quote:
Originally Posted by Vit77 View Post
It's sort of new utility with some new possibilities.
In general, it could work as a replacement for a majority of different Unix network commands.

<snip>
'ip tool' has been around for quite some time. It's just that a lot of new people don't use it.
Code:
excerpt from 'man ip'
       ip - show / manipulate routing, devices, policy routing and tunnels

SYNOPSIS
       ip [ OPTIONS ] OBJECT { COMMAND | help }

       OBJECT := { link | addr | route | rule | neigh | tunnel | maddr |
               mroute | monitor }

       OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] | -f[amily] { inet
               | inet6 | ipx | dnet | link } | -o[neline] }

       ip link set DEVICE { up | down | arp { on | off } |
               promisc { on | off } |
               allmulti { on | off } |
               dynamic { on | off } |
               multicast { on | off } |
               txqueuelen PACKETS |
               name NEWNAME |
               address LLADDR | broadcast LLADDR |
               mtu MTU } ...

HISTORY
       ip was written by Alexey N. Kuznetsov and added in Linux 2.2.
The use of the 'ip tool' can be very powerful to the user. One needs to read the 'man 'ip' to get a better understanding.

Last edited by onebuck; 10-15-2008 at 09:03 AM.
 
Old 10-15-2008, 12:47 AM   #13
Vit77
Member
 
Registered: Jun 2008
Location: Toronto, Canada
Distribution: SuSE, RHEL, Mageia
Posts: 132

Rep: Reputation: 17
Quote:
Originally Posted by ritam_bkp View Post
this "ip" command does not work 4 me??
This command should be run with root priviledges. So, you can run it as
Code:
sudo ip addr show
It is part of the iproute2 package (Advanced IP routing and network device configuration tools​). AFAIK, it has to work in Ubuntu by default.
 
Old 10-17-2008, 02:26 AM   #14
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by ncsuapex View Post
If he's trying to get his external IP from the command line he can use wget:


wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
Not all network connections lead to the internet, and even if a connection does, the IP address used to connect to the server you reference may or may not be masked by a firewall. For example, a wireless router will generally have a WAN address while giving out LAN addresses to the connected machines.
ta0kira

Last edited by ta0kira; 10-17-2008 at 02:28 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
could not find the internet address for x64template? Mark_667 Red Hat 1 02-14-2008 11:10 AM
error message: can not find internet address for 29:2a:ff tavm Linux - Software 6 12-18-2004 01:35 AM
socket: Address family not supported by protocol utumno Linux - Networking 0 12-05-2004 03:19 AM
Could Not Find Internet Address on startup of GNOME SAE Riddler Linux - Newbie 1 05-26-2004 11:21 AM
How to detect the address bit from a protocol. vedion Linux - Software 0 04-30-2004 05:35 AM

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

All times are GMT -5. The time now is 03:55 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration