CCNA实验–NAT和PAT的配置
下面是实验拓扑图:
相关说明:NAT用于提供几乎无限的地址空间并掩藏内部网络寻址方案,地址管理更加容易,它允许严格控制进入和离开网络的流量;但是静态或动态NAT都存在一个问题,它只能提供一对一的地址转换。使用端口地址转换PAT可以实现地址复用的功能,使用PAT后,所有通过地址转换设备的机器都拥有了分配给它们相同IP地址,因此源端口号用来区分不同的连接。实验过程:
I:配置各路由器的IP地址,确保直连接口能Ping通。
II:KC-R1模拟企业网关路由器。
KC-R1(config)#ip route #指向外网的静态路由
IV:配置NAT。
方法一:静态NAT
KC-R1(config)#int f0/0
KC-R1(config-if)#ip nat inside #将f0/0设置为内网口
*Mar 1 00:05:: %LINEPROTO-5-UPDOWN: Line protocol on Interface NVI0, changed state to up
KC-R1(config-if)#exit
KC-R1(config)#int s1/0
KC-R1(config-if)#ip nat outside #将s1/0设置为外网口
KC-R1(config-if)#exit
KC-R1(config)#ip nat inside source static #静态NAT
KC-R1(config)#exit
Ping测试:
PC-1#ping #测试证明能通
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:
!!!!!
ess rate is 100 percent (5/5), round-trip min/avg/max = 120/122/132 ms
此时PC-1能通,PC-2不能通。
KC-R2#debug ip packet #查看数据包
*Mar 1 00:09:: IP: tableid=0, s= (Serial1/0), d= (Serial1/0), routed via RIB
*Mar 1 00:09:: IP: s= (Serial1/0), d= (Serial1/0), len 100, rcvd 3
*Mar 1 00:09:: IP: s= (local), d=, len 100, unroutable
………………….
*Mar 1 00:23:: IP: s= (local), d= (Serial1/0), len 100, sending
*Mar 1 00:23:: IP: table
CCNA实验–NAT和PAT的配置 来自淘豆网m.daumloan.com转载请标明出处.