The UNIX and Linux Forums  

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 05:12 PM
how to? launch command with string of command line options TinCanFury Shell Programming and Scripting 5 04-28-2008 03:06 PM
inconsistent ls command display at the command prompt & running as a cron job rajranibl Linux 5 07-30-2007 05: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 01: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 06:44 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #8  
Old 12-27-2005
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?
Reply With Quote
Forum Sponsor
  #9  
Old 12-28-2005
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?)
Reply With Quote
  #10  
Old 12-28-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
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.
Reply With Quote
  #11  
Old 01-09-2006
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:55 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0