1833767 Members
2075 Online
110063 Solutions
New Discussion

ifconfig

 
SOLVED
Go to solution
Shivkumar
Super Advisor

ifconfig

Is ifconfig command not available in hpux similar to other unix ?

Thanks,
Shiv
18 REPLIES 18
James R. Ferguson
Acclaimed Contributor

Re: ifconfig

Hi Shiv:

'ifconfig' exists. Do:

# whereis ifconfig

...to see "where'.

Regards!

...JRF...
Patrick Wallek
Honored Contributor
Solution

Re: ifconfig

HP-UX does have ifconfig available.

# /usr/sbin/ifconfig

Are you seeing problems or errors when running it?
Rick Garland
Honored Contributor

Re: ifconfig

Unsure what you mean. ifconfig command is available in HPUX.

Some of the command options/switches may be different between the flavors

What are you attempting to do?

Juan M Leon
Trusted Contributor

Re: ifconfig

ifconfig is similar in SUN, I am not sure about AIX or linux.
What Unix you are looking to find the ifconfig.
Ranjith_5
Honored Contributor

Re: ifconfig

Hi Shiva,

if config is available in HP-UX too.
its /usr/sbin/ifconfig

http://docs.hp.com/en/B2355-60103/ifconfig.1M.html

Standard output would be

#ifconfig lan1
lan1: flags=1843
inet 172.17.112.4 netmask ffffff00 broadcast 172.17.112.255

Regards,
Syam
Raj D.
Honored Contributor

Re: ifconfig

Hi Shiv ,

ifconfig is available in hp-ux and here is few details may help you :

1. /usr/sbin/ifconfig lan1 [ to see the details of the interface lan1 ]
2. ifconfig lan2 up [ you can make a down interface up ]

3. you can configure the interface like this:
# ifconfig lan0 10.110.5.1 netmask 255.255.255.224

Cheers ,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor

Re: ifconfig

Shiv ,
Also you can see :

# man set_parms , and /etc/rc.config.d/netconf [The configuration file , which keeps the network related informations ] , for further details ,

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Shivkumar
Super Advisor

Re: ifconfig

Actually, i wanted to see all the network interfaces using ifconfig command.

Thanks,
Shiv
Patrick Wallek
Honored Contributor

Re: ifconfig

You would have to use a combination of lanscan and ifconfig.

Use lanscan to find the interface names (lan0, lan1, etc.)

Then use 'ifconfig lan0' (or whatever the interface name is) to see the details.

You can also use 'netstat -in' to see each interface and its ip address.
Alan Meyer_4
Respected Contributor

Re: ifconfig

heres a script that will cycle through the "configured" lan interfaces and outputs the lan#, IP address and netmask...

" I may not be certified, but I am certifiable... "
Alan Meyer_4
Respected Contributor

Re: ifconfig

suppose to be attached.. Hmmmmm
" I may not be certified, but I am certifiable... "
James R. Ferguson
Acclaimed Contributor

Re: ifconfig

Hi Shiv:

In HP-UX you can do:

lanscan |awk 'NR > 2 {print $5}'|while read line
> do
> ifconfig ${line}
> done

...to get a view of all interfaces with 'ifconfig'.

Regards!

...JRF...
Raj D.
Honored Contributor

Re: ifconfig

Hi Shiv ,

Here is a simple script that will help you finding all lan cards IP and details , in the system :

#########################################
for i in `lanscan | grep lan | awk '{print $5}' | sort `
do
echo $i
ifconfig $i
echo "-------------------------------------------------------------------"
done
###########################################


Enjoy , Have fun,
Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Devesh Pant_1
Esteemed Contributor

Re: ifconfig

Shiv,
I know what you mean when you say ifconfig like other operating systems.

On HP UX ifconfig works with specific lan device only and there is nothing like ifconfig -a

To get everything, I use three commands complementing each other and providing information.

lanscan

netstat -in

ifconfig

thanks
DP
Yogeeraj_1
Honored Contributor

Re: ifconfig

hi shiv,

i normally use the following script:

# more speed-lan.sh
#!/usr/bin/sh
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
#


hope this helps too!

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)

Re: ifconfig


I think better to use (netstat -in)

sheers

Re: ifconfig


I think better to use (netstat -in)

cheers
Mahesh Kumar Malik
Honored Contributor

Re: ifconfig

Hi Shiv

ifconfig is available on hpux as well as per following

#/usr/sbin/ifconfig

Please refer to man pages for details on options

Regards
Mahesh