IPGlobalStatistics.ForwardingEnabled Property

 

Gets a Boolean value that specifies whether Internet Protocol (IP) packet forwarding is enabled.

Namespace:   System.Net.NetworkInformation
Assembly:  System (in System.dll)

public abstract bool ForwardingEnabled { get; }

Property Value

Type: System.Boolean

A Boolean value that specifies whether packet forwarding is enabled.

This value determines whether the computer forwards IP datagrams destined for another computer. Typically, routers forward packets and host computers do not.

The following code example displays the value of this property.

public static void ShowIPStatistics()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IPGlobalStatistics ipstat = properties.GetIPv4GlobalStatistics();
    Console.WriteLine("  Forwarding enabled ...................... : {0}", 
        ipstat.ForwardingEnabled);
    Console.WriteLine("  Interfaces .............................. : {0}", 
        ipstat.NumberOfInterfaces);
    Console.WriteLine("  IP addresses ............................ : {0}", 
        ipstat.NumberOfIPAddresses);
    Console.WriteLine("  Routes .................................. : {0}", 
        ipstat.NumberOfRoutes);
    Console.WriteLine("  Default TTL ............................. : {0}", 
        ipstat.DefaultTtl);
}

.NET Framework
Available since 2.0
Return to top
Show: