Hostname<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
F0
S2/0
Enaacle
console
Gateway
<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />10.10.10.1/24
200.2.2.18/30
cisco
Cisco
Isp
200.2.2.17/30
cisco
class
内部私有地址
内部全局地址
10.10.10.0
199.99.9.40
199.99.9.60
255.255.255.0
255.255.255.224
255.255.255.224

理解NAT 注意基础的四个概念
●Inside Local Address(内部本地地址)
    指一个网络内部分配给网上主机的IP地址,此地址通常不是Internet上的合法地址,即不是网络信息中心 (NIC)或Internet服务提供商(ISP)所分配的IP地址。
    ●Inside Global Address(内部全局地址)
    用来代替一个或者多个内部本地IP地址的、对外的、Internet上合法的IP地址。
    ●Outside Local Address(外部本地地址)
    一个外部主机相对于内部网所用的IP地址。此地址需要是Internet上合法的地址,但是从内部网可以进行路由的地址空间中进行分配的。
    ●Outside Global Address(外部全局地址)
    由主机拥有者分配给在外部网上主机的IP地址。此地址是从一个从全局可路由的地址或网络空间中分配的。
 
Step 1 配置路由器
ISP
Router#configure terminal
Router(config)#hostname ISP
ISP(config)#enable password cisco
ISP(config)#enable secret class
ISP(config)#line console 0
ISP(config-line)#password cisco
ISP(config-line)#login
ISP(config-line)#exit
ISP(config)#line vty 0 4
ISP(config-line)#password cisco
ISP(config-line)#login
ISP(config-line)#exit
ISP(config)#interface loopback 0
ISP(config-if)#ip address 172.16.1.1 255.255.255.255
ISP(config-if)#exit
ISP(config)#interface serial 0
ISP(config-if)#ip address 200.2.2.17 255.255.255.252
ISP(config-if)#clock rate 64000
ISP(config)#ip route 199.99.9.32 255.255.255.224 200.2.2.18
ISP(config)#end
ISP#copy running-config startup-config
Gateway
Router#configure terminal
Router(config)#hostname Gateway
Gateway(config)#enable password cisco
Gateway(config)#enable secret class
Gateway(config)#line console 0
Gateway(config-line)#password cisco
Gateway(config-line)#login
Gateway(config-line)#exit
Gateway(config)#line vty 0 4
Gateway(config-line)#password cisco
Gateway(config-line)#login
Gateway(config-line)#exit
Gateway(config)#interface fastethernet 0
Gateway(config-if)#ip address 10.10.10.1 255.255.255.0
Gateway(config-if)#no shutdown
Gateway(config-if)#exit
Gateway(config)#interface serial 0
Gateway(config-if)#ip address 200.2.2.18 255.255.255.252
Gateway(config-if)#no shutdown
Gateway(config)#ip route 0.0.0.0 0.0.0.0 200.2.2.17
Step 2 保存配置
copy running-config startup-config.
Step 3 为PC配置正确的IP地址,子网掩码和缺省网关
Step 4 测试网络的连通性
Step 5 创建静态路由
ISP(config)#ip route 199.99.9.32 255.255.255.224 200.2.2.18
ISP#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
Gateway of last resort is not set
     10.0.0.0/24 is subnetted, 1 subnets
S       10.10.10.0 [1/0] via 200.2.2.18
     172.16.0.0/32 is subnetted, 1 subnets
C       172.16.1.1 is directly connected, Loopback0
     200.2.2.0/30 is subnetted, 1 subnets
C       200.2.2.16 is directly connected, Serial2/0
GATEway#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
Gateway of last resort is 200.2.2.17 to network 0.0.0.0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/0
     200.2.2.0/30 is subnetted, 1 subnets
C       200.2.2.16 is directly connected, Serial2/0
S*   0.0.0.0/0 [1/0] via 200.2.2.17
tep 6 创建缺省路由
Gateway(config)#ip route 0.0.0.0 0.0.0.0 200.2.2.17
   
Step 7 定义缺省的公有地址池
Gateway(config)#ip nat pool public_access 199.99.9.40 199.99.9.62
netmask 255.255.255.224
Step 8 创建ACL定义内部私有的IP地址
Gateway(config)#access-list 1 permit 10.10.10.0 0.0.0.255
Step 9 定义内部列表到外部地址池的地址转换
Gateway(config)#ip nat inside source list 1 pool public_access(pool的name )
Step 10 确定接口
Gateway(config)#interface fastethernet 0
Gateway(config-if)#ip nat inside
Gateway(config-if)#interface serial 0
Gateway(config-if)#ip nat outside
Step 11 配置静态映射
Gateway(config)#ip nat inside source static 10.10.10.2 199.99.9.36
Gateway#show ip nat translations
 
 
重要的步骤
 
GATEway(config)# ip nat pool public-access 199.99.9.40 199.99.9.60 netmask 255.255.255.224
GATEway(config)#ip nat inside source list 1 pool public-access
GATEway(config)#access-list 1 permit 10.10.10.0 0.0.0.255

一条静态nat条目 

GATEway(config)#ip nat inside source static 10.10.10.2 199.99.9.36
GATEway#show ip nat translations
Pro  Inside global     Inside local       Outside local      Outside global
---  199.99.9.36       10.10.10.2         ---                ---

 

 

Ping 内网私有地址

 

 ISP #ping 10.10.10.2

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 79/9

转载于:https://blog.51cto.com/dreamhappy2008/177673

CCNA试验-NAT相关推荐

  1. CCNA试验-1标准acl

    ACL,NAT和DHCP的使用和配置<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office&q ...

  2. CCNA 配置试验之一 静态路由

    静态路由的应用场合 • 一个小型到中型的网络,而且没有或只有较小的扩充计划时. • 静态路由要手工输入,手工管理:管理开销对于动态路由来说是一个大大的负担. 静态路由优缺点 • 优点: • 1.对路由 ...

  3. ccna考试真题及经验介绍

    ccna考试真题及经验介绍<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" ...

  4. 网络地址转换NAT详解及配置

    作者介绍: 作者:奇妙的大歪 但行前路,不负韶华! 目录 一.一句话说清楚它是干什么的: 二.概念: 三.实现方式: 四.重点理解: 五.优缺点: 六.NAT的弊端 一.静态NAT的配置 二.动态NA ...

  5. 思科资料的所有资料目录

    1.20140819单臂路由.pdf 2.CCNA 实验手册之Packet_Tracer使用教程.pdf 3.CCNA_Lab_Workbook_Sample_Labs(CDP,静态路由,端口安全). ...

  6. CCNA-CCP考试命令总结

    CCNA试验考试命令总结 路由器实验: router> enable                从用户模式进入特权模式 router# disable or exit   从特权模式退出到用 ...

  7. CCNA配置试验之六 标准ACL和扩展ACL的配置

    访问控制列表分为标准访问控制列表和扩展访问控制列表:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office: ...

  8. CCNA(十五)思科ACL、NAT配置命令

    ACL 访问控制列表 ACL可以根据设定的条件对接口上的数据包进行过滤,允许其通过或丢弃.被广泛地应用于路由器和三层交换机,借助于ACL,可以有效地控制用户对网络的访问,从而最大程度地保障网络安全. ...

  9. 谷德威天津思科CCNA培训之访问控制列表和NAT设置

    谷德威天津思科CCNA培训之访问控制列表和NAT设置 实验五 访问控制列表及地址转换 5.1 实验目的: 1. 熟悉路由器的包过滤的核心技术:访问控制列表: 2. 掌握访问控制列表的相关知识: 3. ...

最新文章

  1. [WC2018]通道——边分治+虚树+树形DP
  2. 计算机桌面文件夹删除如何找回,电脑删除文件如何恢复 误操作的一剂后悔药...
  3. C 语言回顾,数组指针的使用(小鸡肋的使用)
  4. 全球首款64核AMD工作站发布,搭载最新线程撕裂者Pro,号称“地表最强”
  5. 清除右键菜单CMD入口
  6. PHP笔试题——处理大文件(最简单的方法)
  7. 使用OpenCV与百度OCR C++ SDK实现文字识别
  8. 什么是 Spring?
  9. python自关联_Django之Mode的外键自关联和引用未定义的Model方法
  10. swing程序中如何响应鼠标回车事件?
  11. 如何选择python书籍_如何选择一本优质的数据科学书籍
  12. 周末包邮送书和小红包中奖名单公布
  13. python绘制散点图的函数_Python用PyQt5绘制多彩随机散点图,基本控件之QPainter使用详解...
  14. Java Web学习总结(8)——使用Cookie进行会话管理
  15. 加速Qt在线更新--使用traefik-1.7.24(不支持traefik-2.0以上版本
  16. c#实现文件批处理:剪切、复制、删除、改名、分类等
  17. 预处理,编译,汇编,链接程序的区别
  18. 1000个JQuery插件(转载)
  19. java word模板生成pdf,java根据模板生成pdf
  20. bzoj5470 / P4578 [FJOI2018]所罗门王的宝藏//(尚未修正)

热门文章

  1. 面试官:Spring代理目标bean时为何通过TargetSource类型对目标bean封装?
  2. FileItem类的常用方法
  3. 图像目标检测(Object Detection)原理与实现(二)
  4. 怎么把一个Java应用打包成Docker镜像
  5. 面试题:ConcurrentHashMap 和 Hashtable 的区别
  6. Linux 僵尸进程
  7. 怎样查看JVM的默认收集器
  8. linux上安装shell编辑器与linux运维面试题
  9. 通过CVS同步Spring源码
  10. TAB三巨头虚拟币的运用