LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-24-2009, 07:47 AM   #1
vikas saroha
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
Help Me!!


hi,
Can anybody tell me that how to check network interface status in linux.
I mean interface is up or down.
 
Old 07-24-2009, 07:52 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
You can use ifconfig to check your network statistics and this utility is available on most of the distributions irrespective of what you use.
Use man command for more information for it.

Also from next time remember to use better titles for your threads that describe your issues.

Last edited by linuxlover.chaitanya; 07-24-2009 at 07:54 AM.
 
Old 07-24-2009, 08:13 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,602
Blog Entries: 25

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Hi,

Welcome to LQ!

Code:
~#ip link show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:1d:60:ea:30:32 brd ff:ff:ff:ff:ff:ff
I would add that you can look at 'man ip';

Quote:
excerpt from 'man ip';

SYNOPSIS
ip [ OPTIONS ] OBJECT { COMMAND | help }


OBJECT := { link | addr | addrlabel | route | rule | neigh | tunnel |
maddr | mroute | monitor }


OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] | -f[amily] { inet
| inet6 | ipx | dnet | link } | -o[neline] }

ip link set DEVICE { up | down | arp { on | off } |
promisc { on | off } |
allmulticast { on | off } |
dynamic { on | off } |
multicast { on | off } |
txqueuelen PACKETS |
name NEWNAME |
address LLADDR | broadcast LLADDR |
mtu MTU |
netns PID }

ip link show [ DEVICE ]

ip addr { add | del } IFADDR dev STRING

ip addr { show | flush } [ dev STRING ] [ scope SCOPE-ID ] [ to PREFIX
] [ FLAG-LIST ] [ label PATTERN ]

IFADDR := PREFIX | ADDR peer PREFIX [ broadcast ADDR ] [ anycast ADDR ]
[ label STRING ] [ scope SCOPE-ID ]

SCOPE-ID := [ host | link | global | NUMBER ]

FLAG-LIST := [ FLAG-LIST ] FLAG

FLAG := [ permanent | dynamic | secondary | primary | tentative | dep-
recated ]

ip addrlabel { add | del } prefix PREFIX [ dev DEV ] [ label NUMBER ]

ip addrlabel { list | flush }

ip route { list | flush } SELECTOR

ip route get ADDRESS [ from ADDRESS iif STRING ] [ oif STRING ] [ tos
TOS ]

ip route { add | del | change | append | replace | monitor } ROUTE

SELECTOR := [ root PREFIX ] [ match PREFIX ] [ exact PREFIX ] [ table
TABLE_ID ] [ proto RTPROTO ] [ type TYPE ] [ scope SCOPE ]


TYPE := [ unicast | local | broadcast | multicast | throw | unreachable
| prohibit | blackhole | nat ]

TABLE_ID := [ local| main | default | all | NUMBER ]

SCOPE := [ host | link | global | NUMBER ]

FLAGS := [ equalize ]

NHFLAGS := [ onlink | pervasive ]

RTPROTO := [ kernel | boot | static | NUMBER ]

ip rule [ list | add | del | flush ] SELECTOR ACTION

SELECTOR := [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark
FWMARK[/MASK] ] [ dev STRING ] [ pref NUMBER ]

ACTION := [ table TABLE_ID ] [ nat ADDRESS ] [ prohibit | reject |
unreachable ] [ realms [SRCREALM/]DSTREALM ]

TABLE_ID := [ local | main | default | NUMBER ]

ip neigh { add | del | change | replace } { ADDR [ lladdr LLADDR ] [
nud { permanent | noarp | stale | reachable } ] | proxy ADDR }
[ dev DEV ]

ip neigh { show | flush } [ to PREFIX ] [ dev DEV ] [ nud STATE ]

ip tunnel { add | change | del | show } [ NAME ]
[ mode MODE ] [ remote ADDR ] [ local ADDR ]
[ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ] ]
[ encaplimit ELIM ] [ ttl TTL ]
[ tos TOS ] [ flowlabel FLOWLABEL ]
[ [no]pmtudisc ] [ dev PHYS_DEV ] [ dscp inherit ]

...
 
Old 07-24-2009, 08:58 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Welcome to LQ!!

A common method to see if the network is up, DNS is working, and you are actually able to connect to something:

Code:
ping google.com
Did we just do your homework for you?

Last edited by pixellany; 07-24-2009 at 08:59 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off




All times are GMT -5. The time now is 08:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration