Many cases we
will try using google.com in order to find out about our network connections.
Linux provides us various ways in order to check whether there exists a physical
cable connection. In this article we will see how we can find out this
Check for the
available networks,
[root@localhost
work]# cat /sys/class/net/
enp2s0/ lo/ virbr0/
enp2s0/ lo/ virbr0/
Check whether
Physical connection is available,
[root@localhost
work]# cat /sys/class/net/enp2s0/carrier
1
1
[root@localhost work]# cat /sys/class/net/lo/carrier
1
[root@localhost work]# cat /sys/class/net/virbr0/carrier
0
“1” indicates physical connection availability and “0” none.
We can also use
the below commands to check the same
[root@localhost
work]# cat /sys/class/net/enp2s0/operstate
up
up
[root@localhost work]# cat /sys/class/net/virbr0/operstate
down
Hope this tip
helps,
No comments :
Post a Comment