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??
|
Welcome to LQ kakaburra!
ummm...try ifconfig in terminal Quote:
mine says Code:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) it matters what distro your using too please tell us what distro and your computer specs? |
Welcome to LQ
You can use ifconfig |
Quote:
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. |
Quote:
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. |
can you post the output from ifconfig if the modem is connected, but pppoe isn't started ?
|
Quote:
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. |
You could try to look in
Code:
/var/log/messages Code:
dmesg |
@repo
Thankyou. The last few lines of /var/log/messages and dmesg do help. |
The link status from
Code:
ethtool eth0 |
@ mRgOBLIN
Thankyou, that also works. |
All times are GMT -5. The time now is 06:39 AM. |