IPv4InterfaceProperties.IsAutomaticPrivateAddressingActive 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이 인터페이스가 APIPA(Automatic Private IP Addressing) 주소를 사용하는지 여부를 나타내는 Boolean 값을 가져옵니다.
public:
abstract property bool IsAutomaticPrivateAddressingActive { bool get(); };
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public abstract bool IsAutomaticPrivateAddressingActive { get; }
public abstract bool IsAutomaticPrivateAddressingActive { get; }
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
member this.IsAutomaticPrivateAddressingActive : bool
member this.IsAutomaticPrivateAddressingActive : bool
Public MustOverride ReadOnly Property IsAutomaticPrivateAddressingActive As Boolean
속성 값
인터페이스가 APIPA 주소를 사용하면 true
이고, 그렇지 않으면 false
입니다.
- 특성
예제
다음 코드 예제에서는 개체를 IPv4InterfaceProperties 가져오고 해당 데이터를 표시합니다.
public static void DisplayIPv4NetworkInterfaces()
{
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
Console.WriteLine("IPv4 interface information for {0}.{1}",
properties.HostName, properties.DomainName);
Console.WriteLine();
foreach (NetworkInterface adapter in nics)
{
// Only display informatin for interfaces that support IPv4.
if (!adapter.Supports(NetworkInterfaceComponent.IPv4))
{
continue;
}
Console.WriteLine(adapter.Description);
// Underline the description.
Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,'='));
IPInterfaceProperties adapterProperties = adapter.GetIPProperties();
// Try to get the IPv4 interface properties.
IPv4InterfaceProperties p = adapterProperties.GetIPv4Properties();
// Display the IPv4 specific data.
Console.WriteLine(" Index ............................. : {0}", p.Index);
Console.WriteLine(" MTU ............................... : {0}", p.Mtu);
Console.WriteLine(" APIPA active....................... : {0}",
p.IsAutomaticPrivateAddressingActive);
Console.WriteLine(" APIPA enabled...................... : {0}",
p.IsAutomaticPrivateAddressingEnabled);
Console.WriteLine(" Forwarding enabled................. : {0}",
p.IsForwardingEnabled);
Console.WriteLine(" Uses WINS ......................... : {0}",
p.UsesWins);
Console.WriteLine();
}
}
Public Shared Sub DisplayIPv4NetworkInterfaces()
Dim nics As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
Console.WriteLine("IPv4 interface information for {0}.{1}", properties.HostName, properties.DomainName)
Dim adapter As NetworkInterface
For Each adapter In nics
' Only display informatin for interfaces that support IPv4.
If adapter.Supports(NetworkInterfaceComponent.IPv4) = False Then
GoTo ContinueForEach1
End If
Console.WriteLine()
Console.WriteLine(adapter.Description)
' Underline the description.
Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length, "="c))
Dim adapterProperties As IPInterfaceProperties = adapter.GetIPProperties()
' Try to get the IPv4 interface properties.
Dim p As IPv4InterfaceProperties = adapterProperties.GetIPv4Properties()
' Display the IPv4 specific data.
Console.WriteLine(" Index ............................. : {0}", p.Index)
Console.WriteLine(" MTU ............................... : {0}", p.Mtu)
Console.WriteLine(" APIPA active....................... : {0}", p.IsAutomaticPrivateAddressingActive)
Console.WriteLine(" APIPA enabled...................... : {0}", p.IsAutomaticPrivateAddressingEnabled)
Console.WriteLine(" Forwarding enabled................. : {0}", p.IsForwardingEnabled)
Console.WriteLine(" Uses WINS ......................... : {0}", p.UsesWins)
ContinueForEach1:
Next adapter
End Sub
설명
자동 개인 IP 주소를 사용하면 DHCP(동적 호스트 구성 프로토콜) 서버에 액세스할 수 없는 컴퓨터가 공용 주소와 충돌하지 않는 IP 주소를 자동으로 할당할 수 있습니다. 이러한 주소는 169.254.0.0~169.254.255.255 범위에 있습니다.