cisco 路由 nat
Cisco PT模拟实验(19) 路由器的NAT功能配置
实验目的:
掌握NAT网络地址转换的原理及功能
掌握静态NAT的配置,实现局域网访问互联网
掌握广域网(WAN)接入技术的原理
实验背景:
为适应公司不断增长的业务需求,公司欲通过web服务器发布网站,现要求将内网的服务器IP地址映射为全局IP地址,实现外部网络可以访问公司内部服务器www服务,可在出口路由器上配置NAT功能。
技术原理:
实验设备:Router-PT 2台;Switch_2960 1台;PC 2台,Server 1台;直通线,交叉线,串口线。
实验拓扑:
实验步骤:
新建Cisco PT 拓扑图
将各PC及Server的IP及网关地址等设置为自动获取(DHCP)
对各Router进行相关配置(接口IP、时钟频率等)
在Router0和Router1上配置RIP动态路由
在Router0上配置静态NAT
在Router1上配置内外网络接口
测试各终端(PC、Server)之间的互通性
- # PC0 设置
- 222.200.106.2
- //子网掩码和网关
- 255.255.255.0
- 222.200.106.1
- # PC1 设置
- 192.168.1.2
- //子网掩码和网关
- 255.255.255.0
- 192.168.1.1
- # Server0 设置
- 192.168.1.3
- //子网掩码和网关
- 255.255.255.0
- 192.168.1.1
- /*=Part1 Router0 基本配置 */
- Router > enable Router#conf t Router(config)#inter f0 / 0 //进入第0模块第0端口(快速以太网接口)
- Router(config -
- if)#ip address 222.200.106.1 255.255.255.0 //配置f0/0接口IP
- Router(config -
- if)#no shutdown //开启端口,默认关闭
- Router(config -
- if)#exit Router(config)#interface serial 2 / 0 //进入第2模块第0端口(串行接口)
- Router(config -
- if)#ip address 222.200.105.10 255.255.255.0 //配置s2/0接口IP
- Router(config -
- if)#clock rate 64000 //必须配置时钟才可通信
- Router(config -
- if)#no shutdown //开启端口,默认关闭
- Router(config -
- if)#exit
- /*=Part2 RIP动态路由配置 */
- Router(config)#router rip //进入路由配置模式 — 启用RIP协议
- Router(config - router)#version 2 //使用版本2,即RIPv2协议
- Router(config - router)#network 222.200.105.0 //指定需要通告的网络(位于路由接口)
- Router(config - router)#network 222.200.106.0 Router(config - router)# ^ Z Router#show r
- /*=Part1 Router1 基本配置 */
- Router > enable Router#conf t Router(config)#inter f0 / 0 //进入第0模块第0端口(快速以太网接口)
- Router(config -
- if)#ip address 192.168.1.1 255.255.255.0 //配置f0/0接口IP
- Router(config -
- if)#no shutdown //开启端口,默认关闭
- Router(config -
- if)#exit Router(config)#inter s2 / 0 //进入第2模块第0端口(串行接口)
- Router(config -
- if)#ip address 222.200.105.11 255.255.255.0 //配置s2/0接口IP
- Router(config -
- if)#no shutdown //开启端口,默认关闭
- Router(config)#exit
- /*=Part2 RIP动态路由配置 */
- Router(config)#router rip //进入路由配置模式 — 启用RIP协议
- Router(config - router)#version 2 //使用版本2,即RIPv2协议
- Router(config - router)#network 192.168.1.0 //指定需要通告的网络(位于路由接口)
- Router(config - router)#network 222.200.105.0 Router(config - router)#exit
- /*=Part3 静态NAT配置 */
- Router(config)#inter f0 / 0 Router(config -
- if)#ip nat inside //设置内网接口
- Router(config -
- if)#exit Router(config)#inter s2 / 0 Router(config -
- if)#ip nat outside //设置外网接口
- Router(config -
- if)#exit Router(config)#ip nat inside static 192.168.1.2 222.200.105.2 //配置静态NAT映射
- Router(config)#ip nat inside static 192.168.1.3 222.200.105.3 Router(config)# ^ Z Router#show ip nat translations Router#show r
- # PC0 ping 222.200.105.10 //链路通
- ping 192.168.1.2 //链路通
- ping 222.200.106.2 //链路通
- 访问 http: //192.168.1.3 //访问成功
- 访问 http: //222.200.105.3 //访问成功
实验环境: Windows 7,Cisco PT 7.0
参考资料:CCNA学习指南(第7版)
Cisco PT模拟实验(19) 路由器的NAT功能配置
来源: http://www.bubuko.com/infodetail-2325750.html