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 Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 08:12 PM
how to? launch command with string of command line options TinCanFury Shell Programming and Scripting 5 04-28-2008 06:06 PM
inconsistent ls command display at the command prompt & running as a cron job rajranibl SuSE 5 07-30-2007 08:26 AM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr HP-UX 1 10-16-2006 04:16 PM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr Shell Programming and Scripting 0 09-19-2006 09:44 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
  #8 (permalink)  
Old 12-28-2005
vvejendla vvejendla is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 4
both, netstat -in and ipconfig -a show multiple entries on some machines.
One some machnes they just display one entry apart from lo0.


netstat -in
Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
lo0 ............
hme0 ..................
hme1 ...................

How to identify,which is the current machine IP address out of hme0,hme1 etc?
  #9 (permalink)  
Old 12-28-2005
fidodido fidodido is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 49
But vvejendla, you can have multiple ip address depending on the network interfaces you have ? that is, you can have installed two nics on the same server either with different ip addresses, and both are the MACHINE ip addresses. In order to know the "ip address" of the machine, you would need the "interface" name you want to lookup. This is not only on unix, but on every other operating system out there. (am I right?)
  #10 (permalink)  
Old 12-29-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Quote:
Originally Posted by fidodido
But vvejendla, you can have multiple ip address depending on the network interfaces you have ? that is, you can have installed two nics on the same server either with different ip addresses, and both are the MACHINE ip addresses. In order to know the "ip address" of the machine, you would need the "interface" name you want to lookup. This is not only on unix, but on every other operating system out there. (am I right?)
SunOS and FreeBSD allow you to run ifconfig without specifying a network interface. The '-a' option can be used to check all interfaces. Of course, to modify anything an interface name is necessary. However, HP-UX requires that an interface name be provided.

Quote:
Originally Posted by vvejendla
both, netstat -in and ipconfig -a show multiple entries on some machines.
One some machnes they just display one entry apart from lo0.
As fidodido said, that depends from system to system. Some systems will have two network interface cards, some will have one. Systems that are setup as high availability clusters have even more (We have HP-UX systems with 4 NICs - one in use, one failover, two for cluster heartbeat).
Any of the IP addresses shown in netstat/ifconfig can be used to access the system as long as that IP is accessible from the rest of the network.
  #11 (permalink)  
Old 01-09-2006
x-375HK-x x-375HK-x is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 8
i have the following function in my .bashrc ( I'm running solaris)

getip ()
{
/sbin/ifconfig eri0 | awk '/inet/ { print $2 } ' | sed -e s/addr://
}

it prints just my ip
Sponsored Links
Closed Thread

Bookmarks

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 10:46 PM.


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