I'm trying to write a script and the interface column does not display the interface!
C:\>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 ff 27 13 f6 5b ...... TAP-Win32 Adapter V9
0x3 ...08 00 27 53 00 bb ...... AMD PCNET Family PCI Ethernet Adapter - Packet
cheduler Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.0.2.2 10.0.2.15 20
I need a way to find out what interface (as in 0x1, 0x2, 0x3) that route is using. Kind of like how in *nix route will give you:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use **Iface**
192.168.0.0 * 255.255.255.0 U 202 0 0 **eth0**
default 192.168.0.1 0.0.0.0 UG 202 0 0 **eth0**
Also, no where in 'route print' does it say default, my script just assumes the first line with 0.0.0.0 0.0.0.0 in it contains the default gw in the third column, is this a safe assumption?