动态NAT的配置
原创
©著作权归作者所有:来自51CTO博客作者strive88的原创作品,请联系作者获取转载授权,否则将追究法律责任
TOP图如上图
R1的配置:
Press Enter to Start
Router>
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R1
R1(config)#int e0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#ip nat inside
R1(config-if)#no shut
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
R1(config-if)#int s0
R1(config-if)#ip add 192.168.2.5 255.255.255.252
R1(config-if)#ip nat outside
R1(config-if)#clock rate 1000000
R1(config-if)#no shut
%LINK-3-UPDOWN: Interface Serial0, changed state to up
%LINK-3-UPDOWN: Interface Serial0, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down
R1(config-if)#encapsulation hdlc
R1(config-if)#exit
R1(config)#access-list 1 permit 192.168.1.0 0.0.0 .255 //设置允许访问的内部IP地址列表
R1(config)#ip nat pool ssss 202.101.1.1 202.101.2.10 netmask 255.255.255.0 //配置全局IP地址池ssss
R1(config)#ip nat inside source list 1 pool ssss overload //蓝色部分和静态的NAT是一样的,只是内部地址改为list 1,而内部全局地址孜为了pool ssss
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 192.168.1.0
R1(config-router)#network 192.168.2.4
R1(config-router)#end
%LINK-3-UPDOWN: Interface Serial0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up
R2的配置:
Press Enter to Start
Router>
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R2
R2(config)#int e0
R2(config-if)#ip add 202.101.6.1 255.255.255.0
R2(config-if)#no shut
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
R2(config-if)#int s0
R2(config-if)#ip add 192.168.2.6 255.255.255.252
R2(config-if)#no shut
%LINK-3-UPDOWN: Interface Serial0, changed state to up
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 192.168.2.4
R2(config-router)#network 202.101.6.0
R2(config-router)#end
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
//配置R2的telnet
R2(config)#line vty 0 4
R2(config-line)#login
R2(config-line)#password cisco
R2(config-line)#end
在R1和R2上查看NAT信息:
1、R1#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp202.101.1.1:9392 192.168.1.2:9392 202.101.6.1:9392 202.101.6.1:9392
icmp202.101.1.1:9393 192.168.1.2:9393 202.101.6.1:9393 202.101.6.1:9393
icmp202.101.1.1:9394 192.168.1.2:9394 202.101.6.1:9394 202.101.6.1:9394
icmp202.101.1.1:9395 192.168.1.2:9395 202.101.6.1:9395 202.101.6.1:9395
icmp202.101.1.1:9396 192.168.1.2:9396 202.101.6.1:9396 202.101.6.1:9396
icmp202.101.1.1:9392 192.168.1.2:9392 202.101.6.2:9392 202.101.6.2:9392
icmp202.101.1.1:9393 192.168.1.2:9393 202.101.6.2:9393 202.101.6.2:9393
icmp202.101.1.1:9394 192.168.1.2:9394 202.101.6.2:9394 202.101.6.2:9394
icmp202.101.1.1:9395 192.168.1.2:9395 202.101.6.2:9395 202.101.6.2:9395
icmp202.101.1.1:9396 192.168.1.2:9396 202.101.6.2:9396 202.101.6.2:9396
icmp202.101.1.1:9392 192.168.1.3:9392 202.101.6.1:9392 202.101.6.1:9392
icmp202.101.1.1:9393 192.168.1.3:9393 202.101.6.1:9393 202.101.6.1:9393
icmp202.101.1.1:9394 192.168.1.3:9394 202.101.6.1:9394 202.101.6.1:9394
icmp202.101.1.1:9395 192.168.1.3:9395 202.101.6.1:9395 202.101.6.1:9395
icmp202.101.1.1:9396 192.168.1.3:9396 202.101.6.1:9396 202.101.6.1:9396
2、用host 1 telnet到R2,然后查看users:
telnet 202.101.6.1
show users
下一篇:NA,NP,IE学习之路
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
mstp+vrrp+ospf+nat
mstp+vrrp+ospf+nat
优先级 ci Standard -
Cisco 动态nat
动态nat
cisco -
PIX NAT(动态)
PIX NAT(动态)
职场 休闲 PIX NAT(动态) -
动态NAT(NAPT)
学习笔记。不喜勿喷
外网 NAT 服务器