1849977 Members
2834 Online
104049 Solutions
New Discussion

Re: Built-in LAN

 
marc seguin
Regular Advisor

Built-in LAN

I'm writing a script in order to change the
instance ID of the built-in lan card to 0 if not so.
But how to get the right hardware path ?
With ioscan, I can search for the string 'Buit-in' in the description field, but I'm not sure this string always exist.
Or i can search for drivers lan2 or btlan3.
But is the list exhaustive ?

thanks for help.
17 REPLIES 17
Andreas Voss
Honored Contributor

Re: Built-in LAN

Hi,

use the command:
lanscan
This lists also the Station addresses to which you can refer in your script to find the right interface.

Regards

Andrew
Jim Mulshine
Frequent Advisor

Re: Built-in LAN

If you use "ioscan -fnC lan" you get a listing of all lan interfaces. This will also show Fibre Channel controller cards (using driver fcT1_cntl). Other drivers you might get are btlan3,4,5 and 6. Take a look in SAM under Kernel Configuration, Drivers for possible drivers.
marc seguin
Regular Advisor

Re: Built-in LAN

Perhaps my message was confusing.
So, the question is :
I want get the hardware path of the built-in lan card, if any. How to select the right lan card from the result of the command 'ioscan -FClan' ?
Rick Garland
Honored Contributor

Re: Built-in LAN

If you are running with 10.20, there is a State field that will indicate if the card is UP or DOWN.
Rick Garland
Honored Contributor

Re: Built-in LAN

The ifconfig command can be of help as well in 11.00 and 10.20.

ifconfig lan0
If the return is valid data for the interface, go.
Otherwise, mine is coming back and telling me "no such interface".
Rick Garland
Honored Contributor

Re: Built-in LAN

Doing the ioscan -fnClan will show only the lan interfaces. The description of of the built-in LAN will say Built-in LAN. This does not mean that this is the card being used however.
marc seguin
Regular Advisor

Re: Built-in LAN

I don't mind if the card is UP or DOWN, used or not. I just want to find a way to select it precisely. Does the string 'Built-in' always appear on all built-in lan cards ?
Do you know a way to identify it more precisely ?
Rick Garland
Honored Contributor

Re: Built-in LAN

For the 10.20 and 11.00 systems I have, the Built-in string always appears when doing the ioscan -fnClan.

James R. Ferguson
Acclaimed Contributor

Re: Built-in LAN

Hi:

Ditto for 10.20 K & D boxes at my site -- "Built-in LAN" seems safe.

...JRF...
Trevor Dyson
Trusted Contributor

Re: Built-in LAN

Hi,

I can not remember ever seeing an HP9000 without a lan card listed as "Built-in LAN".

I think you will be safe just looking for "Built-in LAN" in the ioscan output (ioscan -fnC lan)

The built in lan card will always be at the same hardware address for a given model of HP9000. If you know what model of HP9000 you are running the script on then you could find the hardware address of the built in lan card from the hardware documentation at http://www.docs.hp.com/hpux/systems/. I think this is probably unnescessary as I think you can rely on there always being a "Built-in lan card" listed in the ioscan output.
I hope this helps - Trevor Dyson
I've got a little black book with me poems in
marc seguin
Regular Advisor

Re: Built-in LAN

I've had the same result on all my machines.
(i.e. the string 'Built-in' appears)
But I've been told it's not always true, and another way is to check the driver, which is always 'btlan3' or 'lan2' for the built-in.
It's still an empirical way, unless somebody can confirm it.
Kofi ARTHIABAH
Honored Contributor

Re: Built-in LAN

Ok, lets see:

1. All built-in lan cards are tied to the HW path corresponding to "Core I/O Adapter"
so:

coreio=`ioscan | grep "Core I/O Adapter" | awk '{ print $1 }'`

2. Now get 'em with:

builtin=`for i in $coreio
do
lanscan | grep $i
done`

3. Now your $builtin will contain the line with the builtin card.

This will work all the time (except when there are two built-in LAN interfaces, in which case it would return two values) but you get the drift right?

Good luck
do
lanscan | grep
nothing wrong with me that a few lines of code cannot fix!
marc seguin
Regular Advisor

Re: Built-in LAN

Hello Kofi,

I'm sorry but your solution doesn't work.

On one machine I have :
> ioscan | grep "Core I/O Adapter"
8/16 ba Core I/O Adapter
8/20 ba Core I/O Adapter

>lanscan
8/16/6 0x0060B007912B 0 UP lan0 ...
8/20/5/2 0x0060B02B0107 1 UP lan1 ...

> ioscan | grep "lan"
8/16/6 lan Built-in LAN
8/20/5/2 lan EISA card HWP1990

So I get the two LAN hardware path, though I have only one built-in'd.


On another machine :
> ioscan |grep "Core I/O Adapter"
8/16 ba Core I/O Adapter

>lanscan
8/0/1/0 0x0060B07ACAD0 1 UP lan1 ...
8/0/20/0 0x0060B0B2E94C 0 UP lan0 ...

>ioscan | grep "lan"
8/0/1/0 lan PCI Ethernet (10110019)
8/0/20/0 lan PCI(10110019) -- Built-in #3

so none of the LAN cards are on the 8/16 bus adapter.


Kofi ARTHIABAH
Honored Contributor

Re: Built-in LAN

Ok Seguin: try this again - cut and paste this


for i in `ioscan | grep "Core I/O Adapter" | awk '{ print $1 }'`
do
lanscan | grep $i
done

nothing wrong with me that a few lines of code cannot fix!
Anthony deRito
Respected Contributor

Re: Built-in LAN

Seguin, it seems better use "Built-in" as a search string than "Core I/O Adapter". While it may work for Kofi, based on the responses so far it seems that most people are finding that "Built-In" works for them.

I checked my systems and the same applies. You can use Kofi's good suggestion about the for loop to and make some string comparisions using the output of lanscan. Just replace "Core I/O Adapter" with "Built-in".

Tony
S Keane
New Member

Re: Built-in LAN

You cannot rely on their being a Built-In string in the output of ioscan -Clan etc.
Especially if you have an N or L class server, or a B2000 or B1000. Especially if you are running HP-UX 11.00.

example (on a B2000)

# ioscan -Clan -fk
Class I H/W Path Driver S/W State H/W Type Description
====================================================================
lan 0 10/0/12/0 btlan3 CLAIMED INTERFACE PCI Ethernet (10110019)
lan 1 10/1/1/0 btlan5 CLAIMED INTERFACE PCI Ethernet (10110019)

The built-in LAN is lan0.

What I have found by trial an error is that the built-in LAN either has 'Built-In LAN'*
or uses the btlan3 or lan2 driver.

* Beware !! this is one example I found ...

Class I H/W Path Driver S/W State H/W Type Description
========================================================================
lan 0 10/8/1/0 btlan4 CLAIMED INTERFACE PCI(10110009) -- Built-in #1
lan 1 10/8/2/0 btlan4 CLAIMED INTERFACE PCI(10110009) -- Built-in #2
lan 2 10/12/6 lan2 CLAIMED INTERFACE Built-in LAN

The 'real' built in LAN is lan2, which uses the lan2 driver.


Patrick Wessel
Honored Contributor

Re: Built-in LAN

Take this a a raw cookbook to change instance no. and check what it can do for you:

1. Create an 'infile' file.

Note: The next command is all one long line, the '' is an
escape for the new line character.

ioscan -kf | grep -e INTERFACE -e DEVICE |
grep -v target |
awk '{printf "%s %s %sn",$3,$1,$2}' > infile

2. Change the instance numbers in the infile.

3. Move infile to /stand:

mv infile /stand/infile

4. Move the ioconfig files:

mv /stand/ioconfig /stand/ioconfig.sav

mv /etc/ioconfig /etc/ioconfig.sav

5. Shutdown the system:

shutdown -ry 0



Good luck
There is no good troubleshooting with bad data