IPAddress.ScopeId 속성

정의

IPv6 주소 범위 식별자를 가져오거나 설정합니다.

public:
 property long ScopeId { long get(); void set(long value); };
public long ScopeId { get; set; }
member this.ScopeId : int64 with get, set
Public Property ScopeId As Long

속성 값

주소의 범위를 지정하는 정수(Long)입니다.

예외

AddressFamily = InterNetwork.

scopeId< 0

또는

scopeId> 0x00000000FFFFFFFF

예제

// Display the type of address family supported by the server. If the
// server is IPv6-enabled this value is: InterNetworkV6. If the server
// is also IPv4-enabled there will be an additional value of InterNetwork.
Console::WriteLine( "AddressFamily: {0}", curAdd->AddressFamily );

// Display the ScopeId property in case of IPV6 addresses.
if ( curAdd->AddressFamily.ToString() == ProtocolFamily::InterNetworkV6.ToString() )
         Console::WriteLine( "Scope Id: {0}", curAdd->ScopeId );

// Display the type of address family supported by the server. If the
// server is IPv6-enabled this value is: InterNetworkV6. If the server
// is also IPv4-enabled there will be an additional value of InterNetwork.
Console.WriteLine("AddressFamily: " + curAdd.AddressFamily.ToString());

// Display the ScopeId property in case of IPV6 addresses.
if(curAdd.AddressFamily.ToString() == ProtocolFamily.InterNetworkV6.ToString())
  Console.WriteLine("Scope Id: " + curAdd.ScopeId.ToString());
' Display the type of address family supported by the server. If the
' server is IPv6-enabled this value is: InterNetworkV6. If the server
' is also IPv4-enabled there will be an additional value of InterNetwork.
Console.WriteLine(("AddressFamily: " + curAdd.AddressFamily.ToString()))

' Display the ScopeId property in case of IPV6 addresses.
If curAdd.AddressFamily.ToString() = ProtocolFamily.InterNetworkV6.ToString() Then
  Console.WriteLine(("Scope Id: " + curAdd.ScopeId.ToString()))
End If

설명

사용되는 컨텍스트에 따라 변경 내용의 ScopeId 의미입니다.

  • 링크-로컬 주소입니다. 여러 인터페이스가 별도의 링크에 연결된 호스트에서 동일한 링크-로컬 주소를 여러 인터페이스에 할당할 수 있습니다. 이러한 모호성을 제거하기 위해 scope 식별자를 사용하여 메시지가 교환되는 인터페이스를 지정합니다.

참고

FP(서식 접두사) FE80으로 식별되는 링크 로컬 주소는 동일한 링크의 인접 노드와 통신할 때 노드에서 사용됩니다.

  • 사이트-로컬 주소. 호스트는 여러 사이트에 연결할 수 있습니다. 이 경우 통신할 특정 사이트를 나타내는 데 scope 식별자가 사용됩니다.

참고

FP(서식 접두사) FEC0으로 식별되는 사이트 로컬 주소는 프라이빗 인트라넷에서 통신할 때 노드에서 사용됩니다.

주소를 사용하여 를 지정 ScopeId 하는 데 사용되는 표기법은 입니다 Address%ScopeId. 예를 들면 FE80::5EFE:192.168.41.30%2.과 같습니다.

적용 대상