此組態範例顯示如何使用IPSec加密兩個私人網路(10.50.50.x和10.103.1.x)之間的流量。網路通過私有地址相互認識。
本文件沒有特定需求。
本文中的資訊係根據以下軟體和硬體版本:
Cisco IOS®軟體版本12.3.1a
思科2691路由器
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
本節提供用於設定本文件中所述功能的資訊。
注意:要查詢有關本文檔中使用的命令的其他資訊,請使用命令查詢工具(僅限註冊客戶)。
本檔案會使用下圖中所示的網路設定。
本檔案會使用這些設定。
路由器A |
---|
Router_A#write terminal Building configuration... Current configuration : 1638 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname Router_A ! boot system flash:c2691-ik9o3s-mz.123-1a.bin ! ip subnet-zero ! ip audit notify log ip audit po max-events 100 no ftp-server write-enable ! crypto isakmp policy 1 hash md5 authentication pre-share crypto isakmp key cisco123 address 95.95.95.2 ! crypto ipsec transform-set rtpset esp-des esp-md5-hmac ! crypto map rtp 1 ipsec-isakmp set peer 95.95.95.2 set transform-set rtpset !--- Include the private network to private network traffic !--- in the encryption process. match address 115 ! no voice hpi capture buffer no voice hpi capture destination ! interface FastEthernet0/0 ip address 99.99.99.2 255.255.255.0 ip nat outside duplex auto speed auto crypto map rtp ! interface FastEthernet0/1 ip address 10.50.50.50 255.255.255.0 ip nat inside duplex auto speed auto ! !--- Except the private network traffic from the !--- Network Address Translation (NAT) process. ip nat inside source route-map nonat interface FastEthernet0/0 overload ip http server no ip http secure-server ip classless ip route 0.0.0.0 0.0.0.0 99.99.99.1 ! !--- Except the private network traffic from the NAT process. access-list 110 deny ip 10.50.50.0 0.0.0.255 10.103.1.0 0.0.0.255 access-list 110 permit ip 10.50.50.0 0.0.0.255 any !--- Include the private network to private network traffic !--- in the encryption process. access-list 115 permit ip 10.50.50.0 0.0.0.255 10.103.1.0 0.0.0.255 ! !--- Except the private network traffic from the NAT process. route-map nonat permit 10 match ip address 110 ! dial-peer cor custom ! line con 0 exec-timeout 0 0 line aux 0 line vty 0 4 login ! end Router_A# |
路由器B |
---|
Router_B#write terminal Building configuration... Current configuration : 1394 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname Router_B ! boot system flash:c2691-ik9o3s-mz.123-1a.bin ! ip subnet-zero ! ip audit notify log ip audit po max-events 100 no ftp-server write-enable ! crypto isakmp policy 1 hash md5 authentication pre-share crypto isakmp key cisco123 address 99.99.99.2 ! crypto ipsec transform-set rtpset esp-des esp-md5-hmac ! crypto map rtp 1 ipsec-isakmp set peer 99.99.99.2 set transform-set rtpset !--- Include the private network to private network traffic !--- in the encryption process. match address 115 ! no voice hpi capture buffer no voice hpi capture destination ! interface FastEthernet0/0 ip address 95.95.95.2 255.255.255.0 ip nat outside duplex auto speed auto crypto map rtp ! interface FastEthernet0/1 ip address 10.103.1.75 255.255.255.0 ip nat inside duplex auto speed auto ! !--- Except the private network traffic from the NAT process. ip nat inside source route-map nonat interface FastEthernet0/0 overload ip http server no ip http secure-server ip classless ip route 0.0.0.0 0.0.0.0 95.95.95.1 ! !--- Except the private network traffic from the NAT process. access-list 110 deny ip 10.103.1.0 0.0.0.255 10.50.50.0 0.0.0.255 access-list 110 permit ip 10.103.1.0 0.0.0.255 any !--- Include the private network to private network traffic !--- in the encryption process. access-list 115 permit ip 10.103.1.0 0.0.0.255 10.50.50.0 0.0.0.255 ! !--- Except the private network traffic from the NAT process. route-map nonat permit 10 match ip address 110 ! dial-peer cor custom ! line con 0 exec-timeout 0 0 line aux 0 line vty 0 4 login ! end Router_B# |
目前沒有適用於此組態的驗證程序。
輸出直譯器工具(僅供註冊客戶使用)支援某些show命令,此工具可讓您檢視show命令輸出的分析。
注意:發出debug命令之前,請參閱有關Debug命令的重要資訊。
debug crypto ipsec sa — 顯示第2階段的IPSec協商。
debug crypto isakmp sa — 顯示第1階段的網際網路安全關聯和金鑰管理協定(ISAKMP)協商。
debug crypto engine — 顯示加密會話。