| 场景 | 外网访问内网服务器 |
|---|---|
| 适用 | 华为 VRP 路由器/防火墙 |
| 命令族 | nat server protocol tcp global <公网IP> <端口> inside <私网IP> <端口> |
华为 VRP
华为 VRP
interface GigabitEthernet0/0/1
nat server protocol tcp global 202.1.1.1 80 inside 192.168.1.10 80
nat server protocol tcp global current-interface 8080 inside 192.168.1.10 80
display nat server思科 IOS
思科 IOS
ip nat inside source static tcp 192.168.1.10 80 202.1.1.1 80
show ip nat translations verbose
show running-config | include source staticH3C Comware
H3C Comware
interface GigabitEthernet1/0/1
nat server protocol tcp global 202.1.1.1 80 inside 192.168.1.10 80
display nat server差异:华为/H3C 用 global…inside… 结构,思科用 inside source static tcp <内网> <端口> <公网> <端口>(内网在前、公网在后,方向感完全相反)。