Monday 13 July 2015

Find out whether an NIC is connected and has link

root@host ~
$ ip link show dev eth0
3: eth0:  mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 00:xx:xx:xx:xx:ef brd ff:ff:ff:ff:ff:ff
root@host ~
$ ip link show dev eth1
2: eth1:  mtu 1500 qdisc pfifo_fast master bond1 state DOWN qlen 1000
    link/ether 00:xx:xx:xx:xx:ed brd ff:ff:ff:ff:ff:ff
root@nost ~