How to check Ethernet in Linux?

后端 未结 5 725
-上瘾入骨i
-上瘾入骨i 2020-12-06 07:26

I need the test case for Ethernet in Linux using C code to check eth0. If eth0 is down, we enable the net then check if up and the test is passed.<

5条回答
  •  日久生厌
    2020-12-06 08:14

    The network interfaces can be seen in sysfs: /sys/class/net/eth[x]. There you can check the link, interface status, and more.

提交回复
热议问题