思科路由器动态NAT配置
生活随笔
收集整理的這篇文章主要介紹了
思科路由器动态NAT配置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
相關學習推薦:?優秀的網工都會NAThttps://blog.csdn.net/XMWS_IT/article/details/121508603?spm=1001.2014.3001.5502
?微思講師-視頻教學??:思科路由器動態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 --- ---總結
以上是生活随笔為你收集整理的思科路由器动态NAT配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 超实用的网络故障排障指南
- 下一篇: linux 中卸载提示设备正忙怎么办?