Monday 16 November 2015

To check Network Link status


[root@pratap ~]#for i in `seq 0 5`; do echo "--- eth$i --"; ethtool eth$i | grep Link; done

--- eth0 --
        Link detected: no
--- eth1 --
        Link detected: no
--- eth2 --
        Link partner advertised link modes:  1000baseT/Full
        Link partner advertised pause frame use: Transmit-only
        Link partner advertised auto-negotiation: Yes
        Link detected: yes
--- eth3 --
        Link partner advertised link modes:  1000baseT/Full
        Link partner advertised pause frame use: Transmit-only
        Link partner advertised auto-negotiation: Yes
        Link detected: yes
--- eth4 --
        Link partner advertised link modes:  1000baseT/Full
        Link partner advertised pause frame use: Transmit-only
        Link partner advertised auto-negotiation: Yes
        Link detected: yes
--- eth5 --
        Link detected: no
      
[root@pratap ~]#

[root@pratap ~]# for i in `seq 0 5`; do echo "--- eth$i --"; ethtool eth$i | grep Port; done
--- eth0 --
        Port: FIBRE
--- eth1 --
        Port: FIBRE
--- eth2 --
        Port: Twisted Pair
--- eth3 --
        Port: Twisted Pair
--- eth4 --
        Port: Twisted Pair
--- eth5 --
        Port: Twisted Pair
[root@pratap ~]#