Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display all ento interfaces IP settings

support utilities

Display all ento interfaces IP settings

by  MoshiachNow  Posted    (Edited  )
This utility displays all IP configurations
This script displays IP settings on all entX interfaces.

Sample output:

lsip.sh
Int IP_address Mask DNS Gateway Domain Speed Selected Type
--- ---------- ---- --- ------- ------ -------------- ------
en0 10.4.27.202 255.255.254.0 10.4.2.12 10.4.26.1 cil.creo.com Auto_Negotiation GIGABIT
en1 10.4.2.12 10.4.26.1 cil.creo.com Auto_Negotiation GIGABIT
===============================================
#!/bin/ksh
# Written on 1/7/03
# Updated April 17, 2005
# Version 1.7
# The script displays IP settings on all ent interfaces

printf "%-4s %-15s %-15s %-14s %-14s %-21s %-20s %-8s\n" "Int" "IP_address" "Mask" "DNS" "Gateway" "Domain" "Speed Selected" "Type"
printf "%-4s %-15s %-15s %-14s %-14s %-21s %-20s %-8s\n" "---" "----------" "----" "---" "-------" "------" "--------------" "------"
for EN in `lsdev -Cs pci| awk '/ent/ { print $1 }'|cut -c 1,2,4`;do
mktcpip -S $EN 2>&1|awk -F: '$0 !~ /host/ {printf ("%-4s %-15s %-15s %-14s %-14s %-22s",$4,$2,$3,$5,$7,$6 )}'
ENT=`echo $EN|cut -c 3`
SPEED=`lsattr -El ent$ENT | grep -i speed|awk '{print $2}'`
if [[ -z $SPEED ]] ;then
SPEED="none"
fi
lscfg -v -l ent$ENT|grep -iE "gigabit|10/100/1000" >/dev/null
if [[ $? = 0 ]] ;then
DESCRIPTION=GIGABIT
else
DESCRIPTION=100BT
fi
printf "%-20s %-20s \n" $SPEED $DESCRIPTION
done
exit
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top