1825008 Members
2733 Online
109678 Solutions
New Discussion юеВ

how to find ip

 
SOLVED
Go to solution
cdslmum
Advisor

how to find ip

Hi All,
i having 10 lan card in my hp-ux 11.31 system each having ip address from them how can i found the ip address of my system
19 REPLIES 19
Horia Chirculescu
Honored Contributor

Re: how to find ip

cat /etc/rc.config.d/netconf

Horia.
Best regards from Romania,
Horia.
Ron Irving
Trusted Contributor

Re: how to find ip

#netstat -rn

take note of lan0, lan1, etc.
Should have been an astronaut.
Steven Schweda
Honored Contributor
Solution

Re: how to find ip

> [...] how can i found the ip address of my
> system[?]

Your "system" does not have an IP address.
Each of its _interfaces_ can have an IP
address. The system _name_ could be
associated with an IP address.

nslookup system_name
and/or:
nsquery hosts system_name


Is there some actual problem which you are
trying to solve?
smatador
Honored Contributor

Re: how to find ip

Hi,

Another command to know which lan and ip is configured [you could for example configure in netconf file and after that someone configure with ifconfig another lanX, so you could have more lan configured even if there are not all configure in netconf ]
# netstat -in
HTH
Patrick Wallek
Honored Contributor

Re: how to find ip

>>#netstat -rn

That'll show the routes on the system.

# netstat -in

will show the interfaces and their IP address(es).
cdslmum
Advisor

Re: how to find ip

Dear all,
when I m giving netstat -in command it shows all lan cards ip address.
i want to know that which is from them exact ip of my host.


Rgds
Shiv
Ron Irving
Trusted Contributor

Re: how to find ip

As mentioned:

#nslookup "hostname"

will give you desired results.

Cheers!

Ron
Should have been an astronaut.
sujit kumar singh
Honored Contributor

Re: how to find ip

hi

compare the netstat -in and /etc/hosts also if required consult the /etc/rc.config.d/netconf file.


regards
sujit
Bill Hassell
Honored Contributor

Re: how to find ip

> when I m giving netstat -in command it shows all lan cards ip address.

which means that your system has multiple IP addresses.

> i want to know that which is from them exact ip of my host.

There is no such thing. The closest you can come to the 'exact' IP address is to run the nslookup with hostname like this:

nslookup $(hostname)

This might be the lan0 address, or it might be lan7...it depends on how your system administrator set up this server. Note that with 10 LAN cards, there are 10 different ways to get to this server (assuming all of the connections are active). And where you are located on the network will determine the 'correct' IP address to use for this server.


Bill Hassell, sysadmin
Steven Schweda
Honored Contributor

Re: how to find ip

> There is no such thing. [...]

Perhaps you'll have better luck with this
than I did.

> Is there some actual problem which you are
> trying to solve?

Still wondering.
Johnson Punniyalingam
Honored Contributor

Re: how to find ip

Always its better you check from

/etc/rc.config.d/netconf

to check you Server/System IP
Problems are common to all, but attitude makes the difference
Taifur
Respected Contributor

Re: how to find ip

Hi,

U can find as follows,

#ifconfig lan0
#ifconfig lan1
#ifconfig lan2.....lan10

or /etc/rc.config.d/netconf

Rgds//
Taifur
Steven Schweda
Honored Contributor

Re: how to find ip

> Always its better you check from
>
> /etc/rc.config.d/netconf

Always better how? Why? A configuration
file like this will tell you what is desired
at system start-up, not necessarily what is
true now. A method is "better" if it tells
you what you wish to know, and, with my weak
psychic powers, I don't know what the
questioner wishes to know. A method is
"always better" only if one always wants the
same thing.

> to check you Server/System IP

Again, a network _interface_ can have an IP
address, not a "Server/System". (That's why
the program is called "ifconfig", not
"serverconfig" or "systemconfig".)
Horia Chirculescu
Honored Contributor

Re: how to find ip

> Note that with 10 LAN cards, there are 10 different ways to get to this server (assuming all of the connections are active)

Just wanted to point out that there are at least 10 different ways (from the IP point of view) to get to the box in the same condition as above. Any of this card can have aliases.

Best regards
Horia.
Best regards from Romania,
Horia.
Jupinder Bedi
Respected Contributor

Re: how to find ip

use the following commands

you can check it by viewing the file

/etc/rc.config.d/netconf

than you can use

netstat -in

if you are sure about the interface name than you can use

ifconfig interface_name


you can also check that which ip is mentioned in your /etc/hosts file

do

nslookup server_name


Good Luck
All things excellent are as difficult as they are rare
cdslmum
Advisor

Re: how to find ip

Dear All,
Thanks a lot for your reply.
Finally I found that exact method to find the host ip is following-
$nslookup hostname

Thanks & Regards
Shiv
Horia Chirculescu
Honored Contributor

Re: how to find ip

>Finally I found that exact method to find the host ip is following-
$nslookup hostname

Just wanted to point out this:

It depends on some other facts if this is giving you the right answer.

You should check on your server how nslookup resolved the hostname to IP. (/etc/nsswitch.conf)

If this looks like this:

hosts: dns files

then you relay on your DNS. If the DNS have a wrong IP address to return when asked for hostname, then you will use that wrong IP adress, regardless the fact that your server have or not assigned that IP address.

Best regards.
Horia.
Best regards from Romania,
Horia.
cdslmum
Advisor

Re: how to find ip

i found the ans.
Steven Schweda
Honored Contributor

Re: how to find ip

> i found the ans.

Now, if you can find the right question to go
with it, ...