幀中繼配置
TTOM: #aaaaaa 1px solid; BACKGROUND-COLOR: #f5f5f5"> FRSW(config)#frame-relay switching FRSW(config)#int s1/0 FRSW(config-if)#encapsulation frame-relay IETF FRSW(config-if)#clock rate 2016000 FRSW(config-if)#frame-relay lmi-type cisco FRSW(config-if)#frame-relay intf-type dce FRSW(config-if)#frame-relay route 102 interface s1/1 201 FRSW(config-if)#no sh FRSW(config-if)#exit FRSW(config)#int s1/1 FRSW(config-if)#encapsulation frame-relay IETF FRSW(config-if)#clock rate 2016000 FRSW(config-if)#frame-relay lmi-type cisco FRSW(config-if)#frame-relay intf-type dce FRSW(config-if)#frame-relay route 201 interface s1/0 102 FRSW(config-if)#no sh FRSW(config-if)#exit
|
首先說明一下,幀中繼一般都租用ISP的,以上的配置都是電信給你配置好的.你得到的就是藍色字體的兩個DLCI值,用于識別幀中繼的線路.如果真的要自己去搞的話,就好像我寫的那樣紅色字體一定不能缺,也必須在前面.然后藍色部分也必須要按順序來!因為后一句的輸入前提是要在DCE上輸入,而不能在DTE上.前一句也定義了DCE端,因為我的環(huán)境是模擬互聯(lián)網(wǎng)的環(huán)境.
在未做site to site vpn前必須配置好基本的網(wǎng)絡環(huán)境,即全網(wǎng)互通信息.
#BJ
BJ(config)#interface f0/0 BJ(config-if)#ip add 10.1.1.254 255.255.255.0 BJ(config-if)#no sh BJ(config-if)#exit BJ(config)#int s1/0 BJ(config-if)#ip add 172.161.1.1 255.255.255.0 BJ(config-if)#encapsulation frame-relay IETF BJ(config-if)#frame-relay map ip 172.161.1.2 102 broadcast BJ(config-if)#no sh BJ(config-if)#exit BJ(config)#ip route 0.0.0.0 0.0.0.0 172.161.1.2 |
#GZ
GZ(config)#interface f0/0 GZ(config-if)#ip add 10.2.2.254 255.255.255.0 GZ(config-if)#no sh GZ(config-if)#exit GZ(config)#int s1/1 GZ(config-if)#ip add 172.161.1.2 255.255.255.0 GZ(config-if)#encapsulation frame-relay IETF GZ(config-if)#frame-relay map ip 172.161.1.1 201 broadcast GZ(config-if)#no sh GZ(config-if)#exit GZ(config)#ip route 0.0.0.0 0.0.0.0 172.161.1.1 |
這樣我們就可以在BJ上ping 通GZ上的內(nèi)網(wǎng)IP
BJ#ping 10.2.2.254 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.2.2.254, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 56/90/184 ms |
接下來就到了真正我們要關(guān)注的地方了.那就是VPN的其中一種配置.這次我只介紹一種,因為VPN的建立有很多種,時間的關(guān)系,我只建立其中的一種.如果有需要的話,我會在將來陸續(xù)的把其他幾種VPN配置也做出來.
BJ(config)#crypto isakmp enable BJ(config)#crypto isakmp policy 10 BJ(config-isakmp)#hash md5 BJ(config-isakmp)#authentication pre-share BJ(config-isakmp)#encryption 3des GZ(config-isakmp)#exit BJ(config)#crypto isakmp key cisco address 172.161.1.2 BJ(config)#crypto ipsec transform-set trset esp-des esp-md5-hmac BJ(cfg-crypto-trans)#exit BJ(config)#access-list 101 permit ip 10.1.1.0 0.0.0.255 10.2.2.0 0.0.0.255 BJ(config)#crypto map eric86 10 ipsec-isakmp % NOTE: This new crypto map will remain disabled until a peer and a valid access list have been configured. BJ(config-crypto-map)#set peer 172.161.1.2 BJ(config-crypto-map)#set transform-set trset BJ(config-crypto-map)#match address 101 BJ(config-crypto-map)#exit BJ(config)#interface Serial1/0 BJ(config-if)#crypto map eric86 BJ(config-if)# *Oct 14 23:06:25.863: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON |
紅色部分:IKE協(xié)商策略配置
藍色部分:設(shè)置預共享密鑰和對端地址
綠色部分:配置IPSEC傳輸模式與CRYPTO訪問列表
橙色部分:創(chuàng)建CRYPTO并自動協(xié)商與設(shè)置參數(shù)
黑底白字部分:為應用CRYPTO MAP到接口!
GZ(config)#crypto isakmp enable GZ(config)#crypto isakmp policy 10 GZ(config-isakmp)#hash md5 GZ(config-isakmp)#authentication pre-share GZ(config-isakmp)#encryption 3des GZ(config-isakmp)#exit GZ(config)#crypto isakmp key cisco address 172.161.1.1 GZ(config)#crypto ipsec transform-set trset esp-des esp-md5-hmac GZ(cfg-crypto-trans)#exit GZ(config)#access-list 101 permit ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255 GZ(config)#crypto map eric86 10 ipsec-isakmp % NOTE: This new crypto map will remain disabled until a peer and a valid access list have been configured. GZ(config-crypto-map)#set peer 172.161.1.1 GZ(config-crypto-map)#set transform-set trset GZ(config-crypto-map)#match address 101 GZ(config-crypto-map)#exit GZ(config)#interface Serial1/1 GZ(config-if)#crypto map eric86 GZ(config-if)# *Oct 14 23:07:28.067: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON |
到這里就已經(jīng)配置完成了VPN.大家可能會問,路本來就通的,怎么去測試VPN到底有沒有實現(xiàn)的問題.這里我的網(wǎng)絡拓撲要測試就只有一個方法了.
本來我不是給大家ping過一次,即使沒有配置VPN就可以通訊的嗎?配置了VPN也是可以通訊的,大家就覺的不知道怎么檢驗是否做成功了.我教大家要么把其中一端的crypto map不應用到接口,把它給NO掉,再去ping 一下看通不通.另外一種就比較麻煩,但可以比較全面的測試VPN通道.那就是利用抓包工具.TELNET協(xié)議大家都知道吧?在里面連接的發(fā)送的密碼是明文方式的,未做VPN是可以抓到明文的,在做了VPN以后抓下來的只能夠是亂碼!!
問題存在于在未做VPN之前,內(nèi)網(wǎng)與內(nèi)網(wǎng)是不應該可以通訊的!這里是我在做的時候感覺奇怪的一點.因為在看書的時候,都是兩個路由器,再用三個網(wǎng)段,并且都做上了默認路由.我在沒有配置VPN的時候就已經(jīng)可以PING通所有的網(wǎng)段,顧此我就一直以為site to site的VPN就必需要這么去做.
我在這里給大家補上一個配置文件,新的配置文件是把幀中繼改為了前面我寫到的路由協(xié)議EIGRP.在做到前面部分的時候大家只會說ping通公網(wǎng)而ping不通內(nèi)網(wǎng).
做完VPN以后大家的ping必須要用擴展模式去ping
BJ#ping Protocol [ip]: Target IP address: 10.2.2.254 Repeat count [5]: Datagram size [100]: Timeout in seconds [2]: Extended commands [n]: y Source address or interface: 10.1.1.254 Type of service [0]: Set DF bit in IP header? [no]: Validate reply data? [no]: Data pattern [0xABCD]: Loose, Strict, Record, Timestamp, Verbose[none]: Sweep range of sizes [n]: Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.2.2.254, timeout is 2 seconds: Packet sent with a source address of 10.1.1.254 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 44/164/240 ms |
【編輯推薦】
- VPN訪問外網(wǎng)不暢 深度剖析破解故障根源
- 柳州老鄰居連鎖超市俠諾VPN應用案例
- 如何讓VPN走上移動之路