Chinaunix

标题: linux如何查看网卡是否插上网线 [打印本页]

作者: tbxuexi2    时间: 2011-10-20 22:18
标题: linux如何查看网卡是否插上网线
用什么命令可以查看linux系统网卡是否插上网线呢???
作者: taojie2000    时间: 2011-10-20 22:22
回复 1# tbxuexi2


    ifconfig ?  看下网卡ip相关信息.
作者: tbxuexi2    时间: 2011-10-20 22:30
不行吧??
作者: chenyx    时间: 2011-10-20 22:31
ethtool eth0
作者: cu_little_bird    时间: 2011-10-20 22:49
ifconfig 看网卡是否up
ethtool也可以
作者: lbseraph    时间: 2011-10-20 23:34
物理连接的话还是ethtool
作者: bikong0411    时间: 2011-10-21 08:46
ifconfig就可以
作者: unixlinuxsys    时间: 2011-10-21 09:17
一般是ethtool
作者: yzkarchive    时间: 2011-10-21 09:48
mii-tool
作者: kangear    时间: 2013-07-23 09:02
回复 9# yzkarchive
PC很好用,但是在busybox上好像没有,在嵌入式linux下就不能用了。{:2_167:}


   
作者: kangear    时间: 2013-07-23 09:03
回复 8# unixlinuxsys
刚在busybox上测试一下,也没有ethtool,嵌入式linux下有没有好的解决方案呢??

   
作者: kangear    时间: 2013-07-23 10:02
本帖最后由 kangear 于 2013-07-23 10:07 编辑

不过我找了找,似乎找到了这两个命令:
http://www.busybox.net/downloads/BusyBox.html
ifplugd
ifplugd [OPTIONS]

Network interface plug detection daemon

Options:

        -n              Do not daemonize
        -s              Do not log to syslog
        -i IFACE        Interface
        -f/-F           Treat link detection error as link down/link up
                        (otherwise exit on error)
        -a              Do not up interface automatically
        -M              Monitor creation/destruction of interface
                        (otherwise it must exist)
        -r PROG         Script to run
        -x ARG          Extra argument for script
        -I              Don't exit on nonzero exit code from script
        -p              Don't run script on daemon startup
        -q              Don't run script on daemon quit
        -l              Run script on startup even if no cable is detected
        -t SECS         Poll time in seconds
        -u SECS         Delay before running script after link up
        -d SECS         Delay after link down
        -m MODE         API mode (mii, priv, ethtool, wlan, auto)
        -k              Kill running daemon

截个图:

作者: kangear    时间: 2013-07-26 09:09
更多关于ifplugd的使用,这里有介绍:http://blog.csdn.net/wangxueang224/article/details/8171733
作者: wenhq    时间: 2013-07-26 09:19
ifconfig 可以看到的,显示RUNNING就是插上了,如果网线用的




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2