H3C Source NAT PAT华三源地址转换 2020-07-03 网络 暂无评论 3418 次阅读 ![h3c-source-NAT-PAT.png](https://blog.moper.net/usr/uploads/2020/07/3218296055.png) 预配置 ``` [r7isp] # sysname r7isp # interface Serial1/0 ip address 20.0.0.100 255.255.255.0 # return [r1] sysname r1 # interface Serial1/0 ip address 20.0.0.1 255.255.255.0 # interface GigabitEthernet0/0 port link-mode route combo enable copper ip address 10.0.0.254 255.255.255.0 # interface GigabitEthernet0/1 port link-mode route combo enable copper ip address 10.1.1.254 255.255.255.0 # user-group system # return [r2pc] # sysname r2pc # interface GigabitEthernet0/0 port link-mode route combo enable copper ip address 10.0.0.1 255.255.255.0 # ip route-static 0.0.0.0 0 10.0.0.254 # return [r3server] # sysname r3server # interface GigabitEthernet0/1 port link-mode route combo enable copper ip address 10.1.1.1 255.255.255.0 # ip route-static 0.0.0.0 0 10.1.1.254 # return ``` 需求场景 内部网络访问外网时,源地址转换为外网接口地址 PAT 企业总部内网 PC、Server,需访问互联网进行补丁升级,网关路由器r1对外接口只有一个公网地址,在路由器上配置源地址转换,当10.0.0.0/24和10.1.1.0/24访问外部资源时,将其源地址转换为网关公网接口地址20.0.0.1。 配置如下: ``` [r1] # acl basic name snat rule 0 permit source 10.0.0.0 0.0.0.255 rule 5 permit source 10.1.1.0 0.0.0.255 # nat address-group 10 address 20.0.0.1 20.0.0.1 # interface Serial1/0 ip address 20.0.0.1 255.255.255.0 nat outbound name snat address-group 10 # return ``` 验证:在r2pc 和 r3server上ping r7isp的接口地址20.0.0.100 r1上通过 display nat session 命令查看NAT转换会话 ![h3c-source-NAT-PAT-V1-526x300.png](https://blog.moper.net/usr/uploads/2020/07/4232409638.png) r7isp通过terminal debugging 和 debugging ip icmp 验证源转换 ![h3c-source-NAT-PAT-V2-740x500.png](https://blog.moper.net/usr/uploads/2020/07/1638574892.png) 转自http://www.itbj.net/h3c-source-nat-pat/ 标签: nat, h3c 本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。