| 场景 | 外网访问内网服务 |
|---|---|
| 适用 | Cisco IOS/IOS-XE |
| 语法 | ip nat inside source static <协议> <内网IP> <内网端口> <公网IP> <公网端口> |
思科 IOS
思科 IOS
ip nat inside source static tcp 192.168.1.10 80 202.1.1.1 80
ip nat inside source static udp 192.168.1.11 53 202.1.1.1 53
show ip nat translations | include 202.1.1.1
show ip nat statistics华为 VRP
华为 VRP
interface GigabitEthernet0/0/1
nat server protocol tcp global 202.1.1.1 80 inside 192.168.1.10 80H3C Comware
H3C Comware
interface GigabitEthernet1/0/1
nat server protocol tcp global 202.1.1.1 80 inside 192.168.1.10 80差异:思科删除映射用 no ip nat inside source static tcp ...(参数要完全一致);华为/H3C 用 undo nat server 按条目删除。