华为 动态 nat 地址 转化

  1. 实验名称:华为 动态 nat 地址转化 

  2. 拓扑图 :

华为 动态 nat 地址 转化 

3.配置思路: 首先配置各终端的ip 地址, 然后 在 AR1 和 AR 3 上启用RIP 动态路由协议,在 AR1 上 配置静态路由,以及动态 nat 让全网保持互通


4. 配置步骤 :配置pc1,pc3 的ip地址

                      # ip address 192.168.10.2  255.255.255.0

                        ip address 192.168.10.1   255.255.255.0

                     #配置AR1 ,AR2,AR3上的ip 地址

                       iterface g0/0/0 

                           ip address 192.168.10.254 255.255.255.0

                              undo shutdown  // 在AR1 上配置

                      intrface g0/0/1

                          ip address  100.1.1.1 255.255.255.0

                            undoshutdown  //在 AR1上配置

                        interface g0/0/0

                           ip address 100.1.1.2 255.255.255.0

                              undo shutdown //在 AR2 上配置

                           interface g0/0/1

                                 ip address 200.1.1.1 255.255.255.0

                                    undo shutdown //在 AR 2上配置

                           interface 

                            inteface g0/0/0

                                ip address 200.1.1.2 // 在 AR3 上配置

 #  在 AR1 配置去往外网的静态路由

        ip router-static 0.0.0.0 0.0.0 100.1.1.2

 # 在 AR3 AR2上配置 动态路由 - rip

        rip 

         version 2

          undo summary

           network 100.0.0.0     

           network 200.1.1.0  

            slient - interface   //AR2 上 配置 ,并且把端口 g0/0/0端口设置成了被动端口,也就是说,端口 g0/0/0只接受包,不向外发包

        # 在 AR1 上配置动态NAT  

              # ACL 2000 //创建 acl  

                rule   5  permit  source  192.168.10.0 0.0.0.255   //定义acl 规则

              # 在AR1端口 g0/0/1 上匹配 去往 外网的流量 

                 interface g0/0/1

                     nat   outbood  2000 // 在端口 g0/0/1 上匹配去往外网的流量  

     验证与测试: ping 

华为 动态 nat 地址 转化


#以上图示,说明全网已经互通了,


注意: 包的走向: 出去的时候先查路由表,再查nat  ,回来的时候,先查 nat 再差路由表


总结 : 动态nat 的处,节省ip 地址。 静态 nat 不节省 ip