Share via


MSFT_NetRoute class

Represents a TCP/IP route.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties.

Syntax

[Dynamic, Provider("VPNClientPSProvider")]
class MSFT_NetRoute : CIM_NextHopRoute
{
  string   Caption;
  string   Description;
  string   ElementName;
  string   InstanceID;
  string   DestinationAddress;
  uint16   AdminDistance;
  uint16   RouteMetric;
  boolean  IsStatic;
  uint16   TypeOfRoute = 3;
  string   DestinationPrefix;
  uint32   InterfaceIndex;
  string   InterfaceAlias;
  string   NextHop;
  uint8    Publish;
  datetime ValidLifetime;
  datetime PreferredLifetime;
  uint8    Store;
  uint16   AddressFamily;
  uint16   Protocol;
};

Members

The MSFT_NetRoute class has these types of members:

Methods

The MSFT_NetRoute class has these methods.

Method Description
Create Creates the route.
Select Selects the best local IP address and best route to reach the specified remote address.

Properties

The MSFT_NetRoute class has these properties.

AddressFamily

Data type: uint16

Access type: Read-only

Indicates whether the address family for this route is v4 or v6.

2

v4

23

v6

AdminDistance

Data type: uint16

Access type: Read-only

The specific administrative distance of this route, overriding any default distances specified by the system or routing service.

This property is inherited from CIM_NextHopRoute.

Caption

Data type: string

Access type: Read-only

Qualifiers: MaxLen (64)

The Caption property is a short textual description (one- line string) of the object.

This property is inherited from CIM_ManagedElement.

Description

Data type: string

Access type: Read-only

The Description property provides a textual description of the object.

This property is inherited from CIM_ManagedElement.

DestinationAddress

Data type: string

Access type: Read-only

The address which serves as the destination to be reached.

This property is inherited from CIM_NextHopRoute.

DestinationPrefix

Data type: string

Access type: Read-only

The destination prefix.

ElementName

Data type: string

Access type: Read-only

A user-friendly name for the object. This property allows each instance to define a user-friendly name in addition to its key properties, identity data, and description information.

Note that the Name property of ManagedSystemElement is also defined as a user-friendly name. But, it is often subclassed to be a Key. It is not reasonable that the same property can convey both identity and a user-friendly name, without inconsistencies. Where Name exists and is not a Key (such as for instances of LogicalDevice), the same information can be present in both the Name and ElementName properties. Note that if there is an associated instance of CIM_EnabledLogicalElementCapabilities, restrictions on this properties may exist as defined in ElementNameMask and MaxElementNameLen properties defined in that class.

This property is inherited from CIM_ManagedElement.

InstanceID

Data type: string

Access type: Read-only

Qualifiers: key, Override ("InstanceID")

Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies an instance of this class. In order to ensure uniqueness within the NameSpace, the value of InstanceID SHOULD be constructed using the following \'preferred\' algorithm:

<OrgID>:<LocalID>

Where <OrgID> and <LocalID> are separated by a colon \':\', and where <OrgID> MUST include a copyrighted, trademarked or otherwise unique name that is owned by the business entity creating/defining the InstanceID, or is a registered ID that is assigned to the business entity by a recognized global authority. (This is similar to the <Schema Name>_<Class Name> structure of Schema class names.) In addition, to ensure uniqueness <OrgID> MUST NOT contain a colon (\':\'). When using this algorithm, the first colon to appear in InstanceID MUST appear between <OrgID> and <LocalID>.

<LocalID> is chosen by the business entity and SHOULD not be re-used to identify different underlying (real-world) elements. If the above \'preferred\' algorithm is not used, the defining entity MUST assure that the resultant InstanceID is not re-used across any InstanceIDs produced by this or other providers for this instance\'s NameSpace.

For DMTF defined instances, the \'preferred\' algorithm MUST be used with the <OrgID> set to \'CIM\'.

This property is inherited from CIM_NextHopRoute.

InterfaceAlias

Data type: string

Access type: Read-only

The user-friendly interface name.

InterfaceIndex

Data type: uint32

Access type: Read-only

The user-friendly interface index.

IsStatic

Data type: boolean

Access type: Read-only

TRUE indicates that this is a static route, and FALSE indicates a dynamically-learned route.

This property is inherited from CIM_NextHopRoute.

NextHop

Data type: string

Access type: Read-only

The next hop address or gateway address.

PreferredLifetime

Data type: datetime

Access type: Read-only

Lifetime over which the route is preferred. The default value is infinite.

Protocol

Data type: uint16

Access type: Read-only

The routing mechanism via which this route was learned.

1

Other

2

Local

3

NetMgmt

4

Icmp

5

Egp

6

Ggp

7

Hello

8

Rip

9

IsIs

10

EsIs

11

Igrp

12

Bbn

13

Ospf

14

Bgp

15

Idpr

16

Eigrp

17

Dvmrp

18

Rpl

19

Dhcp

Publish

Data type: uint8

Access type: Read-only

One of the following values:

No (0)

Not advertised in Route Advertisements. This is the default.

Age (1)

Advertised in Route Advertisements with a finite lifetime.

Yes (2)

Advertised in Route Advertisements with an infinite lifetime.

RouteMetric

Data type: uint16

Access type: Read-only

RouteMetric provides a numeric indication as to the preference of this route, compared to other routes that reach the same destination.

This property is inherited from CIM_NextHopRoute.

Store

Data type: uint8

Access type: Read-only

One of the following values

Active (0)

Change only lasts until next boot.

Persistent (1)

Change is persistent. This is the default.

TypeOfRoute

Data type: uint16

Access type: Read-only

An enumerated integer indicating whether the route is administrator-defined (value=2), computed (via a routing protocol/algorithm, value=3) or the actual route implemented in the network (value=4). The default is a computed route.

This property is inherited from CIM_NextHopRoute.

Administrator Defined Route (2)

Computed Route (3)

Actual Route (4)

ValidLifetime

Data type: datetime

Access type: Read-only

Lifetime over which the route is valid. The default value is infinite.

Requirements

Minimum supported client
Windows 8
Minimum supported server
Windows Server 2012
Namespace
Root\Microsoft\Windows\RemoteAccess\Client
MOF
VPNClientPSProvider.mof
DLL
VPNClientPSProvider.dll