How to view the NIC "interface index" in Windows

  

Sometimes you need to specify the interface index of the NIC when adding routes to the routing command, for example,

route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2

The number following the IF is used to specify the NIC interface. If a machine has multiple network cards, what is the index number of each network card?

One way is to use the arp command, for example:

C:\\>arp -a

interface: 121.52.160.27 --- 0xa

Internet address physical address type

121.52.160.31 ff-ff-ff-ff-ff-ff Static

224.0.0.22 01-00-5e-00-00-16 Static

224.0.0.252 01-00-5e-00-00-fc Static

239.255.255.250 01-00-5e-7f-ff-fa Static

255.255.255.255 ff -ff-ff-ff-ff-ff Static

interface: 166.111.120.27 --- 0xb

Internet address physical address type

166.111.120.1 00-23- 89-5a-6f-00 Dynamic

166.111.120.2 00-23-89-5a-87-00 Dynamic

166.111.120.15 00-10-dc-76-78-76 Dynamic

166.111.120.255 ff-ff-ff-ff-ff-ff Static

224.0.0.22 01-00-5e-00-00-16 Static

224.0. 0.252 01-00-5e-00-00-fc Static

239.255.255.250 01-00-5e-7f-ff-fa Static

255.255.255.255 ff-ff-ff-ff -ff-ff Static

interface: 192.168.120.27 --- 0xc

Internet address physical address type

192.168.120.155 00-1e-4f-13-55-d5 Dynamic

192.168.120.255 ff-ff-ff-ff-ff-ff Static

224.0.0.22 01-00-5e-00-00-16 Static

224.0.0.252 01 -00-5e-00-00-fc Static

239.255.255.250 01-00-5e-7f-ff-fa Static

255.255.255.255 ff-ff-ff-ff-ff -ff Static

The hexadecimal number followed by the IP address of each NIC (interface) is the interface index of the NIC.

But sometimes there are no related items in the ARP form. What should I do now? Use the route print command (or netstat -nr) to display all network device indexes:

C:\\>route -4 print

======== =========================================================== =================

Interface List

12 ...00 22 19 a9 30 61 ...... Broadcom BCM5708C NetXtreme II GigE (NDIS VBD Client) #2

11 ...00 22 19 a9 30 5f ...... Broadcom BCM5708C NetXtreme II GigE (NDIS VBD Client)

10 .. .00 10 18 1a 15 f5 ...... Broadcom NetXtreme Gigabit Ethernet

1 .......................... Software Loopback Interface 1

13 ...02 00 54 55 4e 01 ...... Teredo Tunneling Pseudo-Interface

============ =========================================================== =============

IPv4 Routing Table

======================= =========================================================== ===

Active Routing:

Network Target Netmask Gateway Interface Hops

The number in front of the interface list is the interface index of the NIC.

Copyright © Windows knowledge All Rights Reserved