LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help Me!! (https://www.linuxquestions.org/questions/linux-newbie-8/help-me-742445/)

vikas saroha 07-24-2009 06:47 AM

Help Me!!
 
hi,
Can anybody tell me that how to check network interface status in linux.
I mean interface is up or down.

linuxlover.chaitanya 07-24-2009 06:52 AM

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.

onebuck 07-24-2009 07:13 AM

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 ]

...

pixellany 07-24-2009 07:58 AM

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?


All times are GMT -5. The time now is 01:30 AM.