| 场景 | 按业务协议做映射 |
|---|---|
| 适用 | 三厂 |
| 要点 | 同一端口在 tcp 与 udp 上是两条独立映射,缺少哪条哪条不通 |
华为 VRP
华为 VRP
interface GigabitEthernet0/0/1
nat server protocol tcp global 202.1.1.1 443 inside 192.168.1.20 443
nat server protocol udp global 202.1.1.1 443 inside 192.168.1.20 443
nat server protocol icmp global 202.1.1.1 inside 192.168.1.20思科 IOS
思科 IOS
ip nat inside source static tcp 192.168.1.20 443 202.1.1.1 443
ip nat inside source static udp 192.168.1.20 443 202.1.1.1 443
! ICMP 需要按整机地址做静态 NAT
ip nat inside source static 192.168.1.20 202.1.1.2H3C Comware
H3C Comware
interface GigabitEthernet1/0/1
nat server protocol tcp global 202.1.1.1 443 inside 192.168.1.20 443
nat server protocol udp global 202.1.1.1 443 inside 192.168.1.20 443差异:华为/H3C 支持直接写 nat server protocol icmp;思科要用整机静态 NAT(不带端口的 source static)才能让外网 ping 通内网地址,且会占用一个地址。