实验1网络地址翻译及配置-NAT..doc
文本预览下载声明
实验1 网络地址翻译及配置-NAT
一、实验目的
(1)理解私有IP地址的作用。
(2)理解网络地址翻译(NAT)的概念及作用。
(3)掌握静态NAT和动态NAT的配置。
二、实验环境
(1)两台路由器
(2)一台交换机或集线器
(3)三台PC机
(4)线缆若干
1.1网络拓扑图
1.1路由器配置表
路由器名 E0或Fa0/0 S0或S0/0 环回地址 特权密码 仿真终端密码 Gateway /24 /24 cisco cisco ISP /24 /24 cisco cisco 公网IP地址为/24
三、实验内容与步骤
1.实验准备
(1)按要求完成拓扑的连接
(2) 分配主机的IP地址和缺省网关
(3)清空路由器配置
2.路由器的基本配置
(1)完成接口的配置
Gateway的接口配置:
enable
configure terminal
hostname Gateway
interface fa0/0
ip address
no shutdown
exit
interface s0/0
ip address
clock rate 64000
no shutdown
exit
ISP的接口配置:
enable
configure terminal
hostname ISP
interface s0/0
ip address
no shutdown
exit
interface loopback 0
ip address
no shutdown
exit
2.路由协议的配置
(1)配置动态路由协议
Gateway的路由配置:
Router rip
Network
ISP的路由配置:
Router rip
Network
Network
3.静态NAT的配置
(1)NAT分配表
表1.2 静态NAT分配表
主机名 内部私有IP地址 外部公有IP地址 PC1(WWW) /24 /24 PC2(console) /24 /24
(2)静态NAT配置
Gateway的配置:
enable
configure terminal
ip nat inside source static
ip nat inside source static
(3)指定接口
enable
configure terminal
interface fa0/0
ip nat inside
exit
interface s0/0
ip nat outside
(4)测试与ISP连通性
主机PC1和PC2分别ping (路由器ISP的环回接口)
(5)检查NAT是否正常工作
show ip nat translation //查看当前活跃的转换信息
show ip nat statistics //查看有关转换的统计信息
4. 动态NAT的配置
Gateway的配置:
(1)清空前面实验的静态NAT配置。
enable
configure terminal
no ip nat inside source static
no ip nat inside source static
(2)创建地址池
enable
configure terminal
ip nat pool gateway 55 netmask
(3)设置访问控制列表
enable
configure terminal
access-list 1 permit 55
(4)建立动态地址转换
enable
configure terminal
ip nat inside source list 1 pool gateway
(5)指定接口
enable
configure terminal
interface fa0/0
ip nat inside
exit
interface s0/0
ip nat outside
(6)测试与ISP连通性
主机PC1和PC2分别ping (路由器ISP的环回接口)
(7)检查NAT是否正常工作
show ip nat translation //查看当前活跃的转换信息
show ip nat statistics //查看有关转换的统计信息
显示全部