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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

network card how to disable it

Status
Not open for further replies.

call

Technical User
Oct 31, 2000
127
US
I have a p620 and I want to diable the network card so I can make changes to it.
Right now its set to 10 and I want to set the card to 100 full duplex. when I make the changes it tells me the resource is busy

here is what I do
smit chgenet
I pick the card I want to make changes to. it comes back failed resource is busy /usr/lib/methods/chgent

I went into network interface and where its said network card is up I change to down and it still tell me resource is busy. Can anybody help?

Thanks


 
I found a way just had to detach the card.

Now another question?

How do I put a secondary ip address on the same card?
 
Hi,
the last line in Change/Show is
Apply change to DATABASE only. Default is no, change it
to yes and do your changes. After rebooting changes
will take effect.
Regards Boris
 
Without booting method :

stopsrc -g tcpip
rmdev -dl et# (
rmdev -el en#
rmdev -dl ent#
cfgmgr
smit devices
communication
 
Hi,

We use the following script to enabler the user to remove ANY entX interface interactively:
========================
#!/bin/ksh
############################################################
#A simple script that removes any entX interface,after stopping all network protocols and removing the relevant enX
###########################################################################################

#Get the required entX name from the input
if [[ $1 != ent? ]] ;then
echo “Usage: rment.sh <entX> “
exit 1
fi

ENT=$1 #This is required ent
EN=`echo $1 |cut –c 4` #This is required en number

#Check that entX exists, exit if not
lsdev –Cs pci |grep ent|awk '{ print $1 }'|grep $1
if [[ $? != 0 ]] ;then
echo “$1 does not exist !”
exit 1
fi

while true
do
echo “PLEASE DO NOT RUN FROM TELNET ! THIS OPERATION WILL CUTT OFF ANY IP CONNECTIONS !”
echo &quot;Do you really want to remove the $1 (the script will exit if you choose No) (y/n) [Y]:\c&quot;
read answer
if [[ $answer = [Yy] ]] || [[ -z $answer ]] ;then
#Stop all networking
echo “stoping tcpip . . .”
stopsrc -g tcpip
sleep 5
echo “stoping nfs . . .”
stopsrc -g nfs
sleep 5
echo “removing the en$EN and et$EN . . .”
chdev -l en$EN -a state='down'
chdev -l et$EN -a state='down'
rmdev -dl en$EN
echo “removing the $1 . . .”
rmdev -dl $1
if [[ $? = 0 ]] ;then
echo “$1 was successfully removed.\nTo recover - run cfgmgr ,define TCPIP ,FULL/HALF DUPLEX ,and reboot”
exit 0
else
echo “$1 removal has failed !”
exit 1
fi
elif [[ $answer = [Nn] ]] ;then
exit
else
echo &quot;\n Please answer y/n only !\n&quot;
fi
done



&quot;Long live king Moshiach !&quot;
 
Thanks for all the help.
 
About your question. How do I put a secondary ip address on the same card?

If you want to have the save card with two different ip addresses you can use the command

ifconfig network_interface secondary_ipadress mask alias. e.g:

ifconfig en0 10.1.1.1 255.0.0.0 alias.

If you rebbot the server you have todo this again.

If you want to remove the secondary ip_address:

ifconfig en0 10.1.1.1 delete


Bye.
 
Just created a script to change the interface speed withoud reboot:
==============================================
#!/bin/ksh
##########################################################################
# Version 1.0
# This script enables changing the speed of a chozen network interface without a need fro reboot
# The user gets a list of the existing ent interfaces with teir current speed and IP setting
# Once he chooses the interfaces,he can choose the desired speed
# If you choose the speed that does not match this specific interface - the scripts gives an error
# usage : chent.sh
#####################################################################

#collect all ENTs info into file
for ENT in `lsdev -Cs pci|grep ent | awk '{ print $1 }'`;do
EN=`echo $ENT|cut -c 1,2,4`
mktcpip -S $EN 2>&1|grep -v host|awk -F: '{ printf ("%-4s %-15s %-15s %-12s %-12s ",$4,$2,$3,$5,$7 )}'
SPEED=`lsattr -El $ENT | grep -i media_ | awk '{ print $2 }'`
if [[ -z $SPEED ]] ;then
echo " "
else
echo $SPEED
fi
done > /tmp/EN

COUNT=`wc -l /tmp/EN|awk '{ print $1 }'`
integer A=1
oldIFS=$IFS #change field separator to "end-of-line"
IFS='\n'
while (( $A <= $COUNT )) ;do #fill up the array from the file
INTERFACE[A]=`head -n $A /tmp/EN|tail -1`
A=$A+1
done
A=$A-1

echo "---------------------------------------------------" |tee $LOGFILE
IFS='!' #change field separator to non-existing one just for "select"
echo "WARNING : do NOT try changing the default interface speed from remote !"
echo "This will cut off your remote connection.\n"
echo "Select the destination interface : \n"
printf "%-2s %-4s %-15s %-15s %-12s %-12s %-26s\n" " " "Int" "IP_address" "Mask" "DNS" "Gateway" "Speed"
printf "%-2s %-4s %-15s %-15s %-12s %-12s %-26s\n" " " "---" "----------" "----" "---" "-------" "-----"

#Select the INTERFACE
PS3="choose the interface >>"
select DEST_INTERFACE in ${INTERFACE[*]}
do
if [[ -z $DEST_INTERFACE ]]
then
printf -- "Choose the right number \n\n"
else
break
fi
done

IFS=$oldIFS #change field separator back to default !

FINAL_INT=`echo $DEST_INTERFACE|awk '{print $1}'|cut -c 3`

ERROR=1
#Select the speed
while [[ $ERROR = 1 ]] ;do
echo "\nSelect the required new speed :\n"
PS3="choose speed>>"
select SPEED_SET in 10_Half_Duplex 10_Full_Duplex 100_Half_Duplex 100_Full_Duplex Auto_Negotiation Exit
do
if [[ -z $SPEED_SET ]] ; then
printf -- "Choose the right number \n\n"
elif [[ $SPEED_SET = "Exit" ]] ;then
exit
else
break
fi
done

chdev -l en$FINAL_INT -a state='down' >/dev/null 2>&1
chdev -l et$FINAL_INT -a state='down' >/dev/null 2>&1
chdev -l en$FINAL_INT -a state='detach' >/dev/null 2>&1
chdev -l et$FINAL_INT -a state='detach' >/dev/null 2>&1
chdev -l ent$FINAL_INT -a media_speed="$SPEED_SET" 2>/dev/null
if [[ $? != 0 ]] ;then
ERROR=1
echo "\nThe selected speed does not match this interface options !"
else
ERROR=0
fi
chdev -l en$FINAL_INT -a state='up' >/dev/null 2>&1
chdev -l et$FINAL_INT-a state='up' >/dev/null 2>&1
done

echo "\nThe new speed is \c"
lsattr -El ent$FINAL_INT | grep -i media_speed|awk '{ print $2 }'
echo " "



Long live king Moshiach !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top