博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
获取本机的ip
阅读量:6164 次
发布时间:2019-06-21

本文共 3859 字,大约阅读时间需要 12 分钟。

 

 In IPv6, link-local addresses always begin with 1111111010 (FE80).

internal class Program    {        private static void Main()        {            try            {                var ipAddress = GetIpAddresses();                foreach (var item in ipAddress)                {                    Console.WriteLine(item.ToString());                }            }            catch (Exception ex)            {                while (ex != null)                {                    Console.WriteLine(ex.Message);                    ex = ex.InnerException;                }            }            Console.ReadLine();        }        ///         /// 获取指定地址族的ip地址        ///         ///         /// 
public static IPAddress[] GetSpecifiedIpAddress(AddressFamily addressFamily) { var addressList = GetIpAddresses(); var ipv4Addresses = addressList.Where(x => x.AddressFamily == addressFamily).ToArray(); return ipv4Addresses; } /// /// 获取本机的所有ip地址 /// ///
public static IPAddress[] GetIpAddresses() { var hostName = Dns.GetHostName(); var hostEntry = Dns.GetHostEntry(hostName); return hostEntry.AddressList; } }

IPAddress

AddressFamily IsIPv6LinkLocal IsIPv6Teredo iScopeId

fe80::844b:b9e:ee74:566b%11     

InterNetworkV6  True False 11

fe80::18de:188f:3f57:feed%13  

InterNetworkV6   True   False 13

192.168.0.18    

InterNetwork  False False 不支持

192.168.1.18    

InterNetwork  False False 不支持

2001:0:b4a8:29af:18de:188f:3f57:feed

InterNetworkV6    False True   0

 

 

 网卡的本地IPv6地址

 隧道适配器的本地IPv6地址

 

 本地的IPv4

本地的IPv4

 隧道适配器的IPv6地址

 

 

上面的5个地址:

IPv6:  语法参见

fe80::844b:b9e:ee74:566b%11

fe80::14c8:c62:3f57:feed%13

中间的双冒号,缺省了3组0

%后面的是zone id

 

IPv4:

192.168.0.18

192.168.1.18

 

最后一个地址2001:0:b4a8:29af:14c8:c62:3f57:feed也是属于隧道适配器的

 

fe80::14c8:c62:3f57:feed%13  

这个IPv6地址是属于隧道适配器的(6to4)  

隧道适配器 Teredo Tunneling Pseudo-Interface:

连接特定的 DNS 后缀 . . . . . . . :

描述. . . . . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
物理地址. . . . . . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP 已启用 . . . . . . . . . . . : 否
自动配置已启用. . . . . . . . . . : 是
IPv6 地址 . . . . . . . . . . . . : 2001:0:b4a8:29af:86a:789:3f57:feed(首选)

本地链接 IPv6 地址. . . . . . . . : fe80::86a:789:3f57:feed%13(首选)

默认网关. . . . . . . . . . . . . : ::
TCPIP 上的 NetBIOS . . . . . . . : 已禁用

 

 

 

 

Global unicast addresses

A global unicast address is simply what we call a public IP address in IPv4—that is, an IP address that is routed across the whole Internet.

You can make out a global unicast address easily: The first three bits are set to 001.

Thus, the address prefix of a global IPv6 address is 2000::/3 because 0010000000000000 is 2000 in hex.

However, in the future, the IANA (Internet Assigned Numbers Authority) might delegate currently unassigned portions of the IPv6 address space.

Hence, 2000::/3 won’t always be the prefix for global unicast addresses.

(Note: The diagram is from Microsoft’s “.”)

以0x2001   ,前面3个bit是001  Global Routing Prefix 是 0 0000 0000 0001 +4个字节(32位)

 

 

 

In , Teredo is a  that gives full  connectivity for IPv6-capable hosts that are on the   but have no native connection to an IPv6 network.

Unlike similar protocols, it can perform its function even from behind  (NAT) devices such as home routers.

 

Teredo operates using a   that provides  (Internet Protocol version 6) connectivity by  IPv6  packets within IPv4  (UDP) packets.

Teredo routes these datagrams on the  and through NAT devices.

Teredo nodes elsewhere on the IPv6 network (called Teredo relays) receive the packets, un-encapsulate them, and pass them on.

 

Teredo is a temporary measure.

In the long term, all IPv6 hosts should use native IPv6 connectivity.

Teredo should be disabled when native IPv6 connectivity becomes available. 

 developed Teredo at , and the  standardized it as .

The Teredo server listens on UDP port 3544.

转载地址:http://iekba.baihongyu.com/

你可能感兴趣的文章
java8函数式编程实例
查看>>
jqgrid滚动条宽度/列显示不全问题
查看>>
在mac OS10.10下安装 cocoapods遇到的一些问题
查看>>
css技巧
查看>>
Tyvj 1728 普通平衡树
查看>>
javascript性能优化
查看>>
多路归并排序之败者树
查看>>
java连接MySql数据库
查看>>
深入python的set和dict
查看>>
DEV实现日期时间效果
查看>>
java注解【转】
查看>>
centos 下安装g++
查看>>
下一步工作分配
查看>>
Response. AppendHeader使用大全及文件下载.net函数使用注意点(转载)
查看>>
centos64i386下apache 403没有权限访问。
查看>>
jquery用法大全
查看>>
PC-BSD 9.2 发布,基于 FreeBSD 9.2
查看>>
css斜线
查看>>
Windows phone 8 学习笔记(3) 通信
查看>>
Revit API找到风管穿过的墙(当前文档和链接文档)
查看>>