Sponsored Content
Top Forums UNIX for Dummies Questions & Answers NIC The Status Down but I can ping the localhost??!! Post 27433 by geoquest on Saturday 31st of August 2002 09:42:57 AM
Old 08-31-2002
NIC The Status Down but I can ping the localhost??!!

Hello,

hi guys I don't know what is the problem with my NIC I can ping the Localhost (LOOPBACK) but when I run a scripts to check the NIC statuse it's shown the NIC DOWN sooo what could be the problem and what is the best way to start trouplshooting the NIC in SUN-SOLARIS.

Regards,
Karim

this is the script I got it to check the NIC status
Code:
----------------------------------SCRIPT--------------------------------
#!/bin/ksh

################################################################################
# Simple script to GET stats about network cards
# Should work on hme and qfe. Will NOT change anything.
# Will report on speed and config of all network interfaces.
# Paul Bates 27.03.2000
# James Council 26.09.2001
# 	- changed output to one liners.
# 	- Added IPversion check.
################################################################################
REV=`tput rev`
BOLD=`tput bold`
NORM=`tput sgr0`
NDD=/usr/sbin/ndd
IFC="/sbin/ifconfig -a"

typeset -R5 INUM
typeset -R9 AUTOSPEED
typeset -R6 STATUS
typeset -R5 SPEED
typeset -R5 MODE
typeset -R7 VERSION

#---- Function to test that the user is root.
#
Check_ID()
{
ID=$(whoami)
if [ $ID != "root" ]; then
        echo "$ID, you must be root to run this program."
        exit 1
fi
}

Check_NIC()
{
${NDD} -set /dev/${1} instance ${2}

INUM=$1$2
echo "$INUM \c"

autospeed=`${NDD} -get /dev/${1} adv_autoneg_cap`
case $autospeed in
   1) AUTOSPEED=on ; echo "$AUTOSPEED \c"		      ;;
   0) AUTOSPEED=off ; echo "$AUTOSPEED \c"                    ;;
   *) AUTOSPEED=Error ; echo "$AUTOSPEED \c"                  ;;
esac

status=`${NDD} -get /dev/${1} link_status`
case $status in
   1) STATUS=Up ; echo "$STATUS \c"			      ;;
   0) STATUS=DOWN ; echo "$STATUS \c"                         ;;
   *) STATUS=Error ; echo "$STATUS \c"                        ;;
esac

speed=`${NDD} -get /dev/${1} link_speed`
case $speed in
   1) SPEED=100MB ; echo "$SPEED \c"			      ;;
   0) SPEED=10MB ; echo "$SPEED \c"                           ;;
   *) SPEED=Error ; echo "$SPEED \c"                          ;;
esac

mode=`${NDD} -get /dev/${1} link_mode`
case $mode in
   1) MODE=FDX ; echo "$MODE \c"    			      ;;
   0) MODE=HDX ; echo "$MODE \c"        		      ;;
   *) MODE=Error ; echo "$MODE \c"                            ;;
esac

echo $3
}

Check_ID
echo
echo $BOLD" Link Autospeed Status Speed  Mode Version"
echo "----- --------- ------ ----- ----- -------"$NORM
${IFC}| grep -v "^lo0"| egrep "^[a-z,A-z]"|
while read interface flags junk
do
 type=$(echo $interface | cut -c1-3)
 inum=$(echo $interface | cut -c4)
 VERSION=$(echo $flags| sed 's/[<>]//g'| nawk -F, '{print $NF}') 
 Check_NIC $type $inum $VERSION
done

################################################################################
# End
################################################################################

added code tags for readability --oombera

Last edited by oombera; 02-18-2004 at 01:10 PM..
 

10 More Discussions You Might Find Interesting

1. Solaris

PING - Unknown host 127.0.0.1, Unknown host localhost - Solaris 10

Hello, I have a problem - I created a chrooted jail for one user. When I'm logged in as root, everything work fine, but when I'm logged in as a chrooted user - I have many problems: 1. When I execute the command ping, I get weird results: bash-3.00$ usr/sbin/ping localhost ... (4 Replies)
Discussion started by: Przemek
4 Replies

2. Shell Programming and Scripting

NIC status bash shell

Hi can someone tell me what command i can use to find the NIC status im using the bash shell. I'v tried ifconfig -a but this comes back as command not found. (3 Replies)
Discussion started by: warlock129
3 Replies

3. Shell Programming and Scripting

Status of NIC

Can anybody tell me the command to find out the current status of Network Interface Card? (2 Replies)
Discussion started by: warlock129
2 Replies

4. Solaris

x86 Solaris 10 nic driver added but not attached. NIC is not detected.

I couldn't install my nic in solaris 10. I compiled and added the driver but failed to attach the driver and ifconfig output shows only loopback dev. Please see the following output and tell me whether my nic has been detected and why the driver failed to attach? My nic is detected in linux... (0 Replies)
Discussion started by: vectrum
0 Replies

5. Red Hat

I want to tune NIC's rps, rfs and xps value. which NIC device should I modify.

Dear All I want tune my NIC's rps, rfs and xps value. In my system I have two NIC (eth0, eth1) and I have a bond0 ( eth0, eth1). Here is the question? Which device should I modify ? eth0 and eth1? or just modify bond0 or modify all device (eth0, eth1, bond0) Any advice is welcome.... (0 Replies)
Discussion started by: nnnnnnine
0 Replies

6. AIX

Unable to ping localhost

Hi all, I have gone through many posts related to this issue,but my issue wasn't resolved hence creating new thread. I am unable to ping localhost. ping localhost tries to ping localhost which is defined in DNS. My /etc/hosts has entry for localhost as 127.0.0.1 loopback localhost. ... (8 Replies)
Discussion started by: chpsam
8 Replies

7. Solaris

Network issue on multinic. Unable to ping a host from One NIC but other works

Dear, I hope you all will be ok. I have an issue with Solaris box running on x86 Blade. I am unable to ping a node neither traceroute. I am able to do traceroute from oce0:6 port which have IP and subnet of same type which oce0:1 has. details are as follows: Problem: root@rinams02:/#... (3 Replies)
Discussion started by: khaniqshahid
3 Replies

8. Solaris

Nic Failed Status

Hi guys, Another problem here and I appreciate the help, the interface in the solaris v440 is showing as "FAILED" ce0: flags=19040803<UP,BROADCAST,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,FAILED> mtu 1500 index 2 inet 192.168.1.30 netmask ffffff00 broadcast 192.168.1.255 ... (14 Replies)
Discussion started by: br1an
14 Replies

9. Shell Programming and Scripting

Network script for ping status

Actually I am using Red hat Linux 4.4 version. I want to check the 16 client pc status of connection from server.Whether the connection is available or not.I tried to develop the shell script for this code.But It don't work properly.I am a self study learner.Please give me a shell script for this... (9 Replies)
Discussion started by: kannansoft1985
9 Replies

10. Linux

Add two different subnet public IPs to single NIC or two different NIC on same box

Hello Admins, My ask is how can I add two different subnet IPs to same box with two different gateways? The issue is I can connect to the box when I am on ethernet LAN, but I am not able to connect to the same IP when I am on wifi. The server is RHEL 7 VM on vmware. How can I get connected... (4 Replies)
Discussion started by: snchaudhari2
4 Replies
rtw(7D) 							      Devices								   rtw(7D)

NAME
rtw - RealTek 8180L 802.11b Wireless NIC driver DESCRIPTION
The rtw 802.11b wireless NIC driver is a multi-threaded, loadable, clonable, GLDv3-based STREAMS driver supporting RealTek 8180L chipset- based NIC's. CONFIGURATION
The rtw driver performs auto-negotiation to determine the data rate and mode. Supported 802.11b data rates are 1, 2, 5.5 and 11 Mbits/sec. The default is 11. The rtw driver supports only BSS networks (also known as "ap" or "infrastructure" networks) and "open"(or "open-system") or "shared sys- tem" authentication. FILES
/dev/rtw* Special character device. /kernel/drv/rtw 32-bit ELF kernel module (x86). /kernel/drv/amd64/rtw 64-bit ELF kernel module (x86). ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |x86 | +-----------------------------+-----------------------------+ |Availability |SUNWrtw | +-----------------------------+-----------------------------+ |Interface stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
dladm(1M), wificonfig(1M), attributes(5), gld(7D), dlpi(7P) 802.11 - Wireless LAN Media Access Control and Physical Layer Specification -- IEEE, 2001 SunOS 5.11 12 Jul 2007 rtw(7D)
All times are GMT -4. The time now is 11:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy