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 !