LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-05-2005, 08:35 PM   #1
IamDaniel
Member
 
Registered: Mar 2003
Location: Sungai Petani
Distribution: Slackware
Posts: 143

Rep: Reputation: 15
How to check eth up or down


How do you guys check your eth* networks up or down...

ifup is distro specific, I believe...

Does any one have a clone / shell script to do the tricks?
 
Old 07-05-2005, 08:36 PM   #2
juanbobo
Member
 
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365

Rep: Reputation: 30
ifconfig should tell you.
 
Old 07-05-2005, 08:51 PM   #3
IamDaniel
Member
 
Registered: Mar 2003
Location: Sungai Petani
Distribution: Slackware
Posts: 143

Original Poster
Rep: Reputation: 15
Thanks...I never used the ifup...

so, does it the same as ifconfig?

I am writing some script and need to check the eth/network status, so it need to be more specific query...

My /sbin/ifconfig:

Code:
eth0      Link encap:Ethernet  HWaddr <snipped>  
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5972 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6380 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5070843 (4.8 Mb)  TX bytes:1123987 (1.0 Mb)
          Interrupt:11 

eth1      Link encap:UNSPEC  HWaddr <snipped>
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:99 errors:0 dropped:0 overruns:0 frame:0
          TX packets:99 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:8321 (8.1 Kb)  TX bytes:8321 (8.1 Kb)
 
Old 07-05-2005, 09:17 PM   #4
juanbobo
Member
 
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365

Rep: Reputation: 30
You could just run ifconfig | grep eth0 and if it returns something then eth0 is up.
 
Old 07-06-2005, 07:18 PM   #5
IamDaniel
Member
 
Registered: Mar 2003
Location: Sungai Petani
Distribution: Slackware
Posts: 143

Original Poster
Rep: Reputation: 15
strange...

I get results even not networked...here's the output of both in `diff' format:

Code:
shell$ diff ifconfig.down.log ifconfig.up.log |less

3,5c3,5
<           UP BROADCAST MULTICAST  MTU:1500  Metric:1
<           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
<           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
---
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:1248 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:1288 errors:0 dropped:0 overruns:0 carrier:0
7c7
<           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
---
>           RX bytes:965604 (942.9 Kb)  TX bytes:233045 (227.5 Kb)
20,21c20,21
<           RX packets:8 errors:0 dropped:0 overruns:0 frame:0
<           TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
---
>           RX packets:28 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
23c23
<           RX bytes:744 (744.0 b)  TX bytes:744 (744.0 b)
---
>           RX bytes:2426 (2.3 Kb)  TX bytes:2426 (2.3 Kb)
 
Old 07-07-2005, 08:34 AM   #6
eeades
Member
 
Registered: Sep 2004
Distribution: Slackware
Posts: 117

Rep: Reputation: 15
try mii-tool, it should work for what you are doing

Eric
 
Old 07-07-2005, 10:39 AM   #7
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Rep: Reputation: 35
Quote:
Originally posted by IamDaniel
Thanks...I never used the ifup...

so, does it the same as ifconfig?

I never heard about it. Just the usefull ifconfig.
 
Old 07-07-2005, 08:25 PM   #8
IamDaniel
Member
 
Registered: Mar 2003
Location: Sungai Petani
Distribution: Slackware
Posts: 143

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by eeades
try mii-tool, it should work for what you are doing

Eric
thanks, for the point out, I'm gonna try it later...if it works, otherwise I'll be back.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
wlan instead of eth jimjamjahaa Linux - Wireless Networking 2 06-12-2005 02:36 AM
Partition check, check double check Vincentius Linux - General 0 12-25-2004 05:47 AM
Media Check= FAIL - MDSUMs Check out tgrier Linux - Newbie 6 11-26-2004 10:07 PM
Boot disk; check. CD in drive; check. Doesn't work; check. Hal DamnSmallLinux 7 02-04-2004 02:10 AM
No eth ???? codedv Debian 6 12-24-2003 04:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:19 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
Open Source Consulting | Domain Registration