NIC The Status Down but I can ping the localhost??!!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers NIC The Status Down but I can ping the localhost??!!
# 1  
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..
# 2  
Old 08-31-2002
The loopback interface in part of (internal to) the kernel and so you don't need a NIC card to ping the loopback interface. Your NIC cards are not loopback interfaces, their are, for example, ethernet cards. These are different interfaces than loopback interfaces.
# 3  
Old 09-01-2002
so how I can make sure that my NIC is Down

is there's any way to find out if my NIC is OK or not
# 4  
Old 09-02-2002
Couple of things to check:

1. Check if interface is configured - # ifconfig -a

2. Check if interface is seen by the kernel - dmesg and grep for the name of the interface, i.e. # dmesg | grep hme or # dmesg | grep eri

3. Try and ping your interface ip address from another device on the network
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question