Operating System - HP-UX
1846187 Members
3946 Online
110254 Solutions
New Discussion

which NIC talks to server?

 
SOLVED
Go to solution
Penny Patch
Occasional Advisor

which NIC talks to server?

Hello,

need some help here!!

I have 3 NIC on my HP-UX 11.0 machine. I need to find out which NIC talks to my server?

How do I do that?
Thanks.
13 REPLIES 13
Hazem Mahmoud_3
Respected Contributor

Re: which NIC talks to server?

Do "ioscan -funC lan" and you will see /dev/ether0 for example as well as /dev/lan0. The other two, will not have those equivalents. Then get the path, and go to the back of the machine and you will know which one of the 3 it corresponds to (physically). That's how I determine it for our server (which has 2 NIC's).

-Hazem
Marco Santerre
Honored Contributor

Re: which NIC talks to server?

If you do a netstat -in, in the column name, what is the name of the lan interface.

You can then do a lanscan and match that lan name with the Name-PPA and find what is the hardware path of your NIC
Cooperation is doing with a smile what you have to do anyhow.
Joshua Scott
Honored Contributor

Re: which NIC talks to server?

If you have them all set up, then all 3 will.

post the output of the lanscan command.

-Josh
What are the chances...
Ron Kinner
Honored Contributor

Re: which NIC talks to server?

Depends on your network. You could have one used for talking at the server and another which receives traffic from the server.

Easiest way is to do a traceroute:

traceroute servername
or
/usr/sbin/traceroute servername

The result should make it clear which interface was used to transmit out. If you repeat the traceroute from the server back to the client you will see which interface receives it.


It's fairly simple to tell from
netstat -rn
which interface goes with which IP address. The trick on a UNIX box is to figure out which physical RJ45 each interface refers to. I think on HPUX the builtin one is always the lowest number but after that you are on your own. (Is the top NIC in a quad card lan1 or lan4?)
We used to have some SCOs which would play musical chairs with the NICs after each boot. IF in doubt set up a ping to a local IP so you know which IP address is involved and then momentarily unplug the CAT5 cable from each NIC until you see the ping stop.

Ron
Stuart Abramson_2
Honored Contributor
Solution

Re: which NIC talks to server?

Here is how I do it:

+ lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
0/0/8/0/0/4/0 0x00306E3812AD 0 UP lan0 snap0 1 ETHER Yes 119
1/0/1/0/0/4/0 0x00306E4A9088 2 UP lan2 snap2 2 ETHER Yes 119
0/0/14/0/0 0x00306E4BD75A 1 UP lan1 snap1 3 ETHER Yes 119
+ netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
172.20.202.107 172.20.202.107 UH 0 lan0 4136
172.20.202.0 172.20.202.107 U 2 lan0 1500
127.0.0.0 127.0.0.1 U 0 lo0 0
default 172.20.202.107 U 0 lan0 1500

The "lanscan" tells me which hardware address is what "lanX".

Then the "netstat -rn" shows me my "routing tables". The active LAN card is the one that has my host IP address in it twice, plus the "UH" in the "flags" column. In this case (I only have 1 LAN card active), it's lan0 at address "0/0/8/0/0/4/0".

This may not be too scientific, but it works for me.
Penny Patch
Occasional Advisor

Re: which NIC talks to server?

Thanks guys.

That helped. one more question..
How do I determine the MAC address of the machine?
Michael Schulte zur Sur
Honored Contributor

Re: which NIC talks to server?

Hi

sam will tell you, when you go to nic configuration. Or use lanadmin.

have fun,

Michael
Hazem Mahmoud_3
Respected Contributor

Re: which NIC talks to server?

You can also find that through GSP. The "ls" command at the GSP prompt will tell you.

-Hazem
Jeff Schussele
Honored Contributor

Re: which NIC talks to server?

Hi Penny,

lanscan will give you the MAC of EACH NIC in the server. It will be in the Station Address column
The machine doesn't have a MAC - per se - but some SW uses the MAC of the built-in NIC as a license key.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Penny Patch
Occasional Advisor

Re: which NIC talks to server?

lanscan | awk '{ print $2 }'
gives
station
address
XXXXXXXXXXXXX

But I just want the XXXXXXXXXXXXXXX
Michael Schulte zur Sur
Honored Contributor

Re: which NIC talks to server?

Hi,

that is:

lanscan | awk '{ print $2 }' | grep "0x"

greetings,

Michael

Penny Patch
Occasional Advisor

Re: which NIC talks to server?

Is that always start with "0x"?
Michael Schulte zur Sur
Honored Contributor

Re: which NIC talks to server?

Hi Penny,

a mac address is displayed in hex and hex numbers start with 0x.

greetings,

Michael