Operating System - HP-UX
1819870 Members
2544 Online
109607 Solutions
New Discussion юеВ

Solaris "ifconfig -a" equivalent command in HP-UX

 
B V B Kumar
Frequent Advisor

Solaris "ifconfig -a" equivalent command in HP-UX

Hi,

Can any body tell me solaris "ifconfig -a" equivalent command in HP-UX to see all interfaces configuration.

Thanks
Kumar
9 REPLIES 9
Shrikant Lavhate
Esteemed Contributor

Re: Solaris "ifconfig -a" equivalent command in HP-UX

Hi,

ifconfig is also available in HPUX. chk man pages for details. Also, mapping for solaris and HPUX commands documents is attched herewith for your future reference.

-=ShRi=-
Will it remain a personal, if I broadcast it here!
Oviwan
Honored Contributor

Re: Solaris "ifconfig -a" equivalent command in HP-UX

hey

for other command mappings check this:
http://h20331.www2.hp.com/Hpsub/cache/288622-0-0-225-121.html

regards
Robert-Jan Goossens
Honored Contributor

Re: Solaris "ifconfig -a" equivalent command in HP-UX

Doug O'Leary
Honored Contributor

Re: Solaris "ifconfig -a" equivalent command in HP-UX

Hey

To answer your specific question, hpux doesn't have the ifconfig -a; you can ifconfig each interface and get the same information, but you can't do them all in one swell foop w/o writing an inline script:

netstat -ain | awk '$1 ~ /^lan/ && $1 !~ /:/ {print $1}' | sort | \
while read i
do
ifconfig $i
done
lan1: flags=1843
inet 135.3.14.111 netmask fffffe00 broadcast 135.3.15.255
lan2: flags=1843
inet 135.3.16.17 netmask fffffe00 broadcast 135.3.17.255

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Geoff Wild
Honored Contributor

Re: Solaris "ifconfig -a" equivalent command in HP-UX

I have a script that I call lancards:

# 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`
ppas=`lanscan | awk '{print $3}'|egrep -v "Crd|In" | 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)}}'`
netm=`ifconfig lan${i} |grep netmask |awk '{print $4}'`
printf "IP Address: %15s- " "$ipa"
#lanadmin -x $i 2>/dev/null | awk '{$1="";printf("%s",$0)}'
lanadmin -x $i 2>/dev/null | awk '{printf("%s",$0)}'
printf " - Netmask: %d.%d.%d.%d\n" `echo $netm | sed 's/../ 0x&/g'`
echo ""
done



Rgds...Geoff
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.
B V B Kumar
Frequent Advisor

Re: Solaris "ifconfig -a" equivalent command in HP-UX

Thanks geoff!

With this i am not able to entire ip configuration of all LAN cards.

I want to see all LAN interfaces configuration with single command like "ifconfig -a" in solaris. Can any body help.
Oviwan
Honored Contributor

Re: Solaris "ifconfig -a" equivalent command in HP-UX

Hey

use lanscan to get all interfaces then use ifconfig lanX

for lan in $(lanscan | grep lan | awk '{print $5}') ; do
echo $lan
ifconfig $lan
done

Regards
B V B Kumar
Frequent Advisor

Re: Solaris "ifconfig -a" equivalent command in HP-UX

Thanks Oviwan,

It is working......


Kumar
B V B Kumar
Frequent Advisor

Re: Solaris "ifconfig -a" equivalent command in HP-UX

Hi Oviwan,

This is not working, if we have assigned multiple IP address for same interface.

Ex:lan0:1 and lan1:1

Thanks
Kumar