LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-15-2009, 06:54 AM   #1
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Rep: Reputation: 0
How to detect eth0 status?


I have an ADSL modem connected to my Ethernet card. I use pppoe-start to connect to the Internet. I want to know whether my modem is switched on (i.e.,if eth0 is up) so that i can run pppoe-start because the pppoe-start script does not seem to check the state of eth0 and tries to start pppoe. Is there any command to know modem's status??
 
Old 08-15-2009, 06:58 AM   #2
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,057

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
Welcome to LQ kakaburra!

ummm...try ifconfig in terminal

Quote:
ifconfig
and uh..I think you can look in /etc/resolvconf and somwhere in there is a file named resolv.conf

mine says

Code:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 71.252.0.12
nameserver 71.242.0.12
search linksys
however, also in /etc/dhcp3 or /etc/ifplugd

it matters what distro your using too

please tell us what distro and your computer specs?
 
Old 08-15-2009, 06:58 AM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,497

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
Welcome to LQ
You can use
ifconfig
 
Old 08-15-2009, 07:11 AM   #4
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by linus72 View Post
Welcome to LQ kakaburra!

ummm...try ifconfig in terminal



and uh..I think you can look in /etc/resolvconf and somwhere in there is a file named resolv.conf

mine says

Code:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 71.252.0.12
nameserver 71.242.0.12
search linksys
however, also in /etc/dhcp3 or /etc/ifplugd

it matters what distro your using too

please tell us what distro and your computer specs?
Thankyou, but even if i switch off the modem, ifconfig still returns eth0's information.Output being


root@darkstar:/root# ifconfig

eth0 Link encap:Ethernet HWaddr 00:16:76:84:6e:c6
inet6 addr: fe80::216:76ff:fe84:6ec6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5935 errors:0 dropped:0 overruns:0 frame:0
TX packets:5940 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3341987 (3.1 MiB) TX bytes:1182225 (1.1 MiB)
Interrupt:23 Base address:0xb800

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:786 errors:0 dropped:0 overruns:0 frame:0
TX packets:786 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:88176 (86.1 KiB) TX bytes:88176 (86.1 KiB)

ppp0 Link encap:Point-to-Point Protocol
inet addr:59.93.69.27 P-t-P:59.93.64.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:233 errors:0 dropped:0 overruns:0 frame:0
TX packets:240 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:122686 (119.8 KiB) TX bytes:47759 (46.6 KiB)

I use Slackware 12.2.
There are no /etc/dhcp3 or /etc/ifplugd files.

Last edited by kakaburra; 08-15-2009 at 07:14 AM.
 
Old 08-15-2009, 07:14 AM   #5
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by repo View Post
Welcome to LQ
You can use
ifconfig
Thankyou, but ifconfig doesn't help as i said in previous post.

NOT: My internet connection is perfectly fine. I just want to know my modem's status (i.e.,switched on/off ) so that i can write a script which automatically runs pppoe-start script if eth0 goes up.
 
Old 08-15-2009, 07:17 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,497

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
can you post the output from ifconfig if the modem is connected, but pppoe isn't started ?
 
Old 08-15-2009, 07:22 AM   #7
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by repo View Post
can you post the output from ifconfig if the modem is connected, but pppoe isn't started ?
root@darkstar:/root# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:76:84:6e:c6
inet6 addr: fe80::216:76ff:fe84:6ec6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6466 errors:0 dropped:0 overruns:0 frame:0
TX packets:6431 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3548870 (3.3 MiB) TX bytes:1319848 (1.2 MiB)
Interrupt:23 Base address:0xb800

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:786 errors:0 dropped:0 overruns:0 frame:0
TX packets:786 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:88176 (86.1 KiB) TX bytes:88176 (86.1 KiB)

As you can see, if pppoe is not started, it doesn't show up in ifconfig's output, but eth0 is always been showed.
 
Old 08-15-2009, 07:33 AM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,497

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
You could try to look in
Code:
/var/log/messages
or
Code:
dmesg
to see if you find a line when the modem is switched on, and go from there
 
Old 08-15-2009, 07:44 AM   #9
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Original Poster
Rep: Reputation: 0
Thumbs up

@repo

Thankyou. The last few lines of /var/log/messages and dmesg do help.
 
Old 08-15-2009, 05:54 PM   #10
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 227Reputation: 227Reputation: 227
The link status from
Code:
ethtool eth0
might be another way for you to check.
 
Old 08-30-2009, 02:28 AM   #11
kakaburra
LQ Newbie
 
Registered: Feb 2009
Distribution: Slackware 13.0 x86_64
Posts: 12

Original Poster
Rep: Reputation: 0
@ mRgOBLIN

Thankyou, that also works.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
API to detect firewall status in Linux huntneeraj Linux - Newbie 1 04-30-2009 02:26 PM
How can a process detect the status of a signal bluehive Linux - Newbie 5 01-22-2008 12:23 PM
how to auto detect the status of sendmail!!!!!!!!!! dhanju Linux - Networking 5 10-22-2005 06:35 AM
Plug status of eth0 undetected saurabhnasa Linux - Networking 1 06-11-2004 07:06 PM
eth0: tx interrupt but no status G-Fox Linux - Networking 3 11-22-2003 09:04 AM


All times are GMT -5. The time now is 02:04 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration