使用ip link show命令,显示结果前面的数字就是接口索引值
AH-00c080:/tmp/home/admin$ ip link show 1: lo: mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: tunl0@NONE: mtu 1480 qdisc noop state DOWN link/ipip 0.0.0.0 brd 0.0.0.0 3: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether c8:66:5d:00:c0:80 brd ff:ff:ff:ff:ff:ff 4: eth0sniffer: mtu 1500 qdisc noop state DOWN qlen 1000 link/ether c8:66:5d:00:c0:80 brd ff:ff:ff:ff:ff:ff 5: wifi0: mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 link/ieee802.11 ca:66:5d:00:c0:94 brd ff:ff:ff:ff:ff:ff 6: wifi1: mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 link/ieee802.11 ca:66:5d:00:c0:a4 brd ff:ff:ff:ff:ff:ff 7: wifi0sniffer: mtu 1500 qdisc noop state DOWN qlen 1000 link/ieee802.11/radiotap ca:66:5d:00:c0:94 brd ff:ff:ff:ff:ff:ff 8: wifi1sniffer: mtu 1500 qdisc noop state DOWN qlen 1000 link/ieee802.11/radiotap ca:66:5d:00:c0:a4 brd ff:ff:ff:ff:ff:ff 9: mgt0: mtu 1500 qdisc noqueue state UNKNOWN link/ether c8:66:5d:00:c0:80 brd ff:ff:ff:ff:ff:ff 10: wifi0.1: mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 link/ether c8:66:5d:00:c0:94 brd ff:ff:ff:ff:ff:ff 12: wifi1.1: mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 link/ether c8:66:5d:00:c0:a4 brd ff:ff:ff:ff:ff:ff