相关学习推荐: 思科路由器动态NAT配置
微思讲师-视频教学 :思科路由器动态NAT配置https://www.zhihu.com/zvideo/1459172004850565120
1. 理解动态NAT的转换原理
2. 掌握动态NAT的配置方法
实验拓扑
1. 根据实验拓扑图,完成设备的基本配置;
2. 在R2上创建Loopback0接口,IP地址是9.2.6.7/32,模拟公网上的一台服务器;
3. 在R1上配置动态NAT,地址池范围为12.1.1.11~12.1.1.20,使得PC1和PC2能够访问公网服务器。
步骤1:设备的基本配置
配置PC1:
Router>enableRouter#configure terminalRouter(config)#hostname PC1PC1(config)#no ip routingPC1(config)#ip default-gateway 192.168.1.254PC1(config)#interface ethernet0/0PC1(config-if)#ip address 192.168.1.1 255.255.255.0PC1(config-if)#no shutdownPC1(config-if)#endPC1#
配置PC2:
Router>enableRouter#configure terminalRouter(config)#hostname PC2PC2(config)#no ip routingPC2(config)#ip default-gateway 192.168.1.254PC2(config)#interface ethernet0/0PC2(config-if)#ip address 192.168.1.2 255.255.255.0PC2(config-if)#no shutdownPC2(config-if)#endPC2#
配置SW1:
Switch>enaSwitch#conf tSwitch(config)#no ip domain-lookupSwitch(config)#line console 0Switch(config-line)# logging sSwitch(config-line)# exec-t 0 0Switch(config-line)# exitSwitch(config)#hostname SW1SW1(config)#endSW1#
配置R1:
Router>enableRouter#configure terminalRouter(config)#hostname R1R1(config)#no ip domain-lookupR1(config)#line console 0R1(config-line)#exec-timeout 0 0R1(config-line)#logging synchronousR1(config-line)#exitR1(config)#interface ethernet0/0R1(config-if)#ip address 192.168.1.254 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR1(config)#interface ethernet0/1R1(config-if)#ip address 12.1.1.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#endR1#
配置R2:
Router>enableRouter#configure terminalRouter(config)#hostname R2R2(config)#no ip domain-lookupR2(config)#line console 0R2(config-line)#exec-timeout 0 0R2(config-line)#logging synchronousR2(config-line)#exitR2(config)#interface loopback0R2(config-if)#ip address 9.2.6.7 255.255.255.255R2(config-if)#exitR2(config)#interface ethernet0/0R2(config-if)#ip address 12.1.1.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#endR2#
步骤2:配置动态NAT
配置R1:
R1(config)#ip nat pool xmws 12.1.1.11 12.1.1.20 netmask 255.255.255.0 //创建地址池R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255 //通过ACL定义哪些子网能做NATR1(config)#ip nat inside source list 1 pool xmws //关联ALC和地址池R1(config)#interface ethernet 0/0R1(config-if)#ip nat inside //指定inside接口R1(config-if)#exitR1(config)#interface ethernet 0/1R1(config-if)#ip nat outside //指定outside接口R1(config-if)#exitR1(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.2 //配置到达公网的默认路由
测试PC1访问服务器:
PC1#ping 9.2.6.7Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 9.2.6.7, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
测试PC2访问服务器:
PC2#ping 9.2.6.7Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 9.2.6.7, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
检查R1的NAT表项:
R1#show ip nat translationsPro Inside global Inside local Outside local Outside globalicmp 12.1.1.12:6 192.168.1.1:6 9.2.6.7:6 9.2.6.7:6--- 12.1.1.12 192.168.1.1 --- ---icmp 12.1.1.13:4 192.168.1.2:4 9.2.6.7:4 9.2.6.7:4--- 12.1.1.13 192.168.1.2 --- ---
今天的文章Cisco NAT配置_思科路由器设置图解分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/58884.html





