分类
完全锥形(Full Cone)
相同的内网(IIP:port)会被映射到同一个外网(EIP:port),此外,外部机器可以直接发送包给(EIP:port),这个包会被转发给(IIP:port);
即这个映射是长期的;而且不拒绝外部机器的包;
限制锥形(Restricted Cone)
相同的内网(IIP:port)会被映射到同一个外网(EIP:port), 不同于完全锥形的NAT,只有在内部机器给外部设备(IP地址为x)发送过包时,这个外部设备发送给(EIP:port)的包才会被转发;否则丢弃掉;
映射也是长期的,不拒绝内网机器试图通信的外部设备;
端口限制型锥形(Port Restricted Cone)
类似于限制锥形NAT;但是更严格,限制范围扩大到了端口;只有内网机器给外部机器的(X:port)发送过包,这个外部机器发送给(EIP:port)的包才不会被丢弃;
对称型(Symmetric)
A symmetric NAT is one where all requests from the
same internal IP address and port, to a specific destination IP
address and port, are mapped to the same external IP address and
port. If the same host sends a packet with the same source
address and port, but to a different destination, a different
mapping is used. Furthermore, only the external host that
receives a packet can send a UDP packet back to the internal host.
局限
- 只支持UDP;不支持TCP;
- 只有部分NAT可用,例如Symmetric,对对称型NAT不起作用;
- 对同处相同NAT后的两个节点不起作用