实验需求:
PC-1/2 要 ping 通 PC-3 ;
华为NAT基本配置实例详解_第1张图片

实验步骤:
1.设备互联、IP地址规划、加电;
2.设备配置
内网设备
终端设备
PC1:
ip 192.168.10.1
mask 255.255.255.0
gateway 192.168.10.254
PC2:
ip 192.168.10.2
mask 255.255.255.0
gateway 192.168.10.254 br/>网络设备
&2层设备-SW
@创建VLAN
@将互联端口加入到指定的VLAN中

         [SW]vlan 10 
             quit 
         [SW]port-group group-member gi0/0/1 to gi0/0/3 
             port link-type access
             port default vlan 10 
             quit         
      3层设备-Router
         [R1]interface gi0/0/2 
     [R1-GigabitEthernet0/0/2] ip address 192.168.10.254 255.255.255.0
     [R1]interface gi0/0/0 
     [R1-GigabitEthernet0/0/0] ip address 12.1.1.1 255.255.255.0             
         [R1]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2    
             [R1]nat static global 12.1.1.3 inside 192.168.10.1
             [R1]nat static global 12.1.1.4 inside 192.168.10.2
             [R1]interface gi0/0/0 
             [R1-GigabitEthernet0/0/0]nat static enable 

外网设备
         [R2]interface gi0/0/1 
             [R2-GigabitEthernet0/0/1] ip address 12.1.1.2 255.255.255.0
             [R2-GigabitEthernet0/0/1] interface gi0/0/0 
                 [R2-GigabitEthernet0/0/0]ip address 13.1.1.254 255.255.255.0

     PC3:
            ip 13.1.1.253 
              mask 255.255.255.0
              gateway 13.1.1.254

测试:
PC1:
192.168.10.1 --> 13.1.1.253
华为NAT基本配置实例详解_第2张图片
测试成功!!!!!

可以利用wireshark抓包验证