How to check Ethernet in Linux?

后端 未结 5 706
-上瘾入骨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:05

    You may want to take advantage of libudev to get around in /sys:

    http://www.signal11.us/oss/udev/
    

提交回复
热议问题