Operating System - HP-UX
1823066 Members
3048 Online
109645 Solutions
New Discussion юеВ

command to find full or half duplex card

 
SOLVED
Go to solution
Shivkumar
Super Advisor

command to find full or half duplex card

What is command on hpux to find whether a network card is configured as 100 full or half duplex ?
7 REPLIES 7
Kofi ARTHIABAH
Honored Contributor
Solution

Re: command to find full or half duplex card

The command you want is lanadmin -x (to view) and -X ( to set)

eg.

lanadmin -x 0
where 0 is the PPA number you get for the card when you do a
lanscan

for more info see man lanadmin

Good luck
nothing wrong with me that a few lines of code cannot fix!
Rajeev  Shukla
Honored Contributor

Re: command to find full or half duplex card

Thats right, on an HP-UX 11.00 onwards lanadmin accepts PPA number and prior to that it was NM ID of the card and both can be found from lanscan

Do a lanscan and get the PPA number of the card you want to query and then run
lanadmin -x

Jan de Haas_3
Frequent Advisor

Re: command to find full or half duplex card

The configuration file for the lancard can be found in /etc/rc/config.d
Probably called hpbtlanconf or somthing similar. You'll be able to change the duplex setting here, so next time the system reboots, you'll retain the duplex setting you want.

You'll be able to change the speed somewhere in the config file and change the current value with on of these : 10hd 10fd 100hd 100fd

The header in the config file should provide enough info though.

Cheers,
Jan.
Geoff Wild
Honored Contributor

Re: command to find full or half duplex card

Here's a good script:

Rgds...Geoff

# cat /usr/local/bin/lancards

#!/usr/bin/sh
# script to check speed and settings of lan cards
PATH=/usr/sbin:/usr/bin
ppas=`lanscan | awk '$3~/^[0-9]$/{print $3}' | xargs`
for i in $ppas
do
printf "Card at PPA %s - " $i
ipa=`ifconfig lan${i} 2>/dev/null | awk '{ip=$2}END{if(ip==""){printf("Not assigned")}else{printf("%s ",ip)}}'`
printf "IP Address: %15s- " "$ipa"
lanadmin -x $i 2>/dev/null | awk '{$1="";printf("%s",$0)}'
echo ""
done
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
rick jones
Honored Contributor

Re: command to find full or half duplex card

If you are thinking you have a duplex mismatch, the following may be helpful:

How Autoneg is supposed to work:

When both sides of the link are set to autoneg, they will "negotiate"
the duplex setting and select full duplex if both sides can do
full-duplex.

If one side is hardcoded and not using autoneg, the autoneg process
will "fail" and the side trying to autoneg is required by spec to use
half-duplex mode.

If one side is using half-duplex, and the other is using full-duplex,
sorrow and woe is the usual result.

So, the following table shows what will happen given various settings
on each side:

Auto Half Full

Auto Happiness Lucky Sorrow

Half Lucky Happiness Sorrow

Full Sorrow Sorrow Happiness

Happiness means that there is a good shot of everything going well.
Lucky means that things will likely go well, but not because you did
anything correctly :) Sorrow means that there _will_ be a duplex
mis-match.

When there is a duplex mismatch, on the side running half-duplex you
will see various errors and probably a number of late collisions. On
the side running full-duplex you will see things like FCS errors.
Note that those errors are not necessarily conclusive, they are simply
indicators.
there is no rest for the wicked yet the virtuous have no pillows
Raj D.
Honored Contributor

Re: command to find full or half duplex card

Hi Shiv,

You can simply try :

1.
# lanscan

( To see the PPA number of the LAN card )

2.
# lanadmin -x PPA_no

i.e Ex: # lanadmin -x 0
( Assuming 0 is PPA number )

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Steven E. Protter
Exalted Contributor

Re: command to find full or half duplex card

Hi Shivkumar,

Background.

Unless the card is very old it should operate in full duplex.

100 BaseT and slower HP-9000 NIC cards need port swtich settings of manual, full duplex and appropriate speed. Otherwise performance is horrendous.

Certain D and K class cards due to reasons unknown to me require a configuration file called /etc/rc.config.d/hpbtlanconf to force a full duplex 100 BaseT startup.

Note that certified 1000 BaseT cards require autonegotiate, on the switch and in the software configuration.

Great answers, fellow itrc'ers

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com