The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SCO get MAC Address jcarter2333 High Level Programming 11 02-08-2007 09:51 AM
How to Achive IP address through MAC(Ethernet) address krishnacins IP Networking 3 08-29-2005 08:45 PM
ce0 and ce1 have the same mac address BG_JrAdmin SUN Solaris 2 07-08-2005 07:30 PM
network address and broadcast address? pnxi UNIX for Dummies Questions & Answers 7 11-10-2003 11:29 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-13-2002
krishna krishna is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 60
IP address

Hi All,

I logged into to a unix machine, from $ prompt what should I type to get IP address of that machine?

Thanks inadvance,

Krishna
  #2 (permalink)  
Old 03-13-2002
jonalthoff jonalthoff is offline
Registered User
  
 

Join Date: Feb 2002
Location: Central Ohio
Posts: 3
netstat is a good start. I don't know much about what it will tell you or the options running it. Try it and see. Hopefully someone else will have more information for you.
  #3 (permalink)  
Old 03-13-2002
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Try typing ifconfig, then enter.
If it doesn't find that command, you'll have to specify the whole path. For example, you might have to enter "/sbin/ifconfig".
You should get something similar to the following:
Quote:
eth0 Link encap:Ethernet HWaddr 00:60:97:C7:9F:72
inet addr:10.2.9.122 Bcast:10.2.255.255 Mask:255.255.0.0
UP BROADCAST NOTRAILERS RUNNING MTU:1500 Metric:1
RX packets:4223201 errors:0 dropped:0 overruns:0 frame:0
TX packets:49783 errors:0 dropped:0 overruns:0 carrier:1
collisions:355 txqueuelen:100
Interrupt:9 Base address:0xfe80

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
You'll notice that there are two entries - one for each interface. The first one is eth0, my primary (and only) ethernet interface. In that block, a field named "inet addr" shows the ip address, in my case, 10.2.9.122.
The second block is lo, the loopback interface. It doesn't physically exist, but nearly every system should have one. It's address will always be 127.0.0.1.
Note that there may be more than one "real" interface. A single machine can technically have 255 (i think) IP addresses assigned to it.

By the way, your interface names may vary. This one is from a Linux box connected via ethernet.
  #4 (permalink)  
Old 03-13-2002
tarek_gh tarek_gh is offline
Registered User
  
 

Join Date: Mar 2002
Location: MILANO (ITALY)
Posts: 6
The easiest thing is:
uname -a and you will see the name of your machine
then ping namemachine
or grep namemachine /etc/hosts
That's it!
  #5 (permalink)  
Old 03-13-2002
#1freebsddude #1freebsddude is offline
Registered User
  
 

Join Date: Feb 2002
Location: www.freebsdforums.org
Posts: 67
You could also do it in 2 steps

#1 Type hostname
#2 nslookup (hit enter, then type the hostname or fully qualified hostname from #1)
  #6 (permalink)  
Old 03-13-2002
auswipe's Avatar
auswipe auswipe is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Wide Awake Wylie, Texas
Posts: 535
Sometimes an `ifconfig` with no switches is not enough.

On my OpenBSD2.9 machine I have to either specify the individual nic or the "-a" switch to display all adapters. Oddly enough, the lone `ifconfig` is sufficient under FreeBSD4.5 to display all adapters and settings.
  #7 (permalink)  
Old 03-14-2002
DPAI's Avatar
DPAI DPAI is offline
Registered User
  
 

Join Date: Jul 2001
Posts: 112
Yup thats right
SOlaris takes a option -a to ifconfig
but IRIX needs to be passed its network interface as the argument , no -a works with it

nslookup is a good option too

But i would rather prefer vi /etc/hosts
Sponsored Links
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0