H3C 官方模拟器H3C Cloud Lab实验二十四 网络地址转换

更新时间:2023-05-06 03:13:11 阅读: 评论:0

H3C 官方模拟器H3C Cloud Lab实验二十四:
网络地址转换NAT
拓扑图:
一、实验要求
1、理解网络地址转换的概念、作用及分类;
2、熟练掌握几种常见的网络地址转换(Static NAT Basic NATNAPTEasy IP);
3、掌握NAT Server的应用场合及配置方法;
二、网络测试,内网计算机无法访问外网
三、几种NAT配置方法
1、Static NAT
在RT中作如下配置:
[RT]nat static outbound 172.16.1.1 198.1.1.101  //静态地址转换内外地址绑定
[RT]nat static outbound 172.16.1.2 198.1.1.102  //静态地址转换内外地址绑定
[RT]int s1/0
[RT-Serial1/0]nat static enable    //接口开启nat static功能
[RT-Serial1/0]quit
用pc1ping198.1.1.2测试,连通!
[RT]dis nat static        //查看静态地址转换信息
Static NAT mappings:
  Totally 2 outbound static NAT mappings.
  IP-to-IP:
    Local IP    : 172.16.1.1
    Global IP    : 198.1.1.101
    Config status: Active
  IP-to-IP:
    Local IP    : 172.16.1.2
    Global IP    : 198.1.1.102
    Config status: Active
Interfaces enabled with static NAT:
  Totally 1 interfaces enabled with static NAT.
  Interface: Serial1/0
    Config status: Active
[RT]dis nat ssion verbo    //查看转换会话详细信息
Slot 0:
Initiator:
  Source      IP/port: 172.16.1.1/49920
  Destination IP/port: 198.1.1.2/2048
  DS-Lite tunnel peer: -
  VPN instance/VLAN ID/VLL ID: -/-/-
  Protocol: ICMP(1)
  Inbound interface: GigabitEthernet0/0
Responder:
  Source      IP/port: 198.1.1.2/49920
  Destination IP/port: 198.1.1.101/0
  DS-Lite tunnel peer: -
  VPN instance/VLAN ID/VLL ID: -/-/-
  Protocol: ICMP(1)
  Inbound interface: Serial1/0
State: ICMP_REPLY
Application: OTHER
Start time: 2015-05-26 10:38:04  TTL: 4s
Initiator->Responder:            0 packets          0 bytes
Responder->Initiator:            0 packets          0 bytes
Total ssions found: 1
[RT]
2、Basic NAT
在RT中先清除静态NAT配置:
[RT]undo nat static outbound 172.16.1.1    //删除nat绑定
[RT]undo nat static outbound 172.16.1.2    //删除nat绑定
[RT]int s1/0
[RT-Serial1/0]undo nat static enable      //关闭nat static使能
[RT-Serial1/0]
作如下配置:
[RT]acl basic 2000        //创建允许转换的地址范围
[RT-acl-ipv4-basic-2000]rule permit source 172.16.1.0 0.0.0.255
[RT-acl-ipv4-basic-2000]quit
[RT]nat address-group 0      //创建外部地址池,将动态分配给内网主机使用
[RT-address-group-0]address 198.1.1.11 198.1.1.20
[RT-address-group-0]quit
[RT]int s1/0
[RT-Serial1/0]nat outbound ?
  INTEGER<2000-3999>  U an ACL to specify the address to be translated
  address-group      Specify a NAT address group
  ds-lite-b4          Configure NAT for DS-Lite B4
  port-block-group    Specify a NAT port block group
  port-prerved      Attempt to prerve the original source port number during
                      PAT
  vpn-instance        Specify a VPN instance
  <cr>
[RT-Serial1/0]nat outbound 2000 address-group 0 ?
  no-pat          Disable Port Address Translation (PAT)
  port-prerved  Attempt to prerve the original source port number during PAT
  vpn-instance    Specify a VPN instance
  <cr>
[RT-Serial1/0]nat outbound 2000 address-group 0 no-pat  //在端口上设置nat
用pc1ping198.1.1.2测试,连通!
[RT]dis nat ssion verbo  //查看nat会话详细信息
Slot 0:
Initiator:
  Source      IP/port: 172.16.1.1/50688
  Destination IP/port: 198.1.1.2/2048
  DS-Lite tunnel peer: -
  VPN instance/VLAN ID/VLL ID: -/-/-
  Protocol: ICMP(1)
  Inbound interface: GigabitEthernet0/0
Responder:
  Source      IP/port: 198.1.1.2/50688
  Destination IP/port: 198.1.1.11/0
  DS-Lite tunnel peer: -
  VPN instance/VLAN ID/VLL ID: -/-/-
  Protocol: ICMP(1)
  Inbound interface: Serial1/0
State: ICMP_REPLY
Application: OTHER
Start time: 2015-05-26 10:56:06  TTL: 19s
Initiator->Responder:            0 packets          0 bytes
Responder->Initiator:            0 packets          0 bytes
Total ssions found: 1
[RT]
3、NAPT
在RT中先清除Basic NAT配置:
[RT]int s1/0
[RT-Serial1/0]undo nat outbound 2000  //删除nat绑定
[RT-Serial1/0]quit
[RT]undo nat address-group 0
//删除nat地址池,注意没有删除允许转换的内网地址
[RT]
作如下配置:
[RT]nat address-group 0  //重新创建外部地址池,注意地址数量
[RT-address-group-0]add 198.1.1.6 198.1.1.6 
[RT-address-group-0]quit
[RT]int s1/0
[RT-Serial1/0]nat outbound 2000 address-group 0  //注意与上例的区别
[RT-Serial1/0]
分别用pc1、pc2 ping198.1.1.2测试,均连通!
[RT]dis nat ssion verbo
Slot 0:
Initiator:
Source      IP/port: 172.16.1.2/46592
  Destination IP/port: 198.1.1.2/2048
  DS-Lite tunnel peer: -
  VPN instance/VLAN ID/VLL ID: -/-/-
  Protocol: ICMP(1)
  Inbound interface: GigabitEthernet0/0
Responder:
  Source      IP/port: 198.1.1.2/3
  Destination IP/port: 198.1.1.6/0
  DS-Lite tunnel peer: -

本文发布于:2023-05-06 03:13:11,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/536880.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:地址   转换   配置   静态   开启   测试   注意   允许
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图