CCIE SEC DM***

 

 
 
 
<<DM***操作細解>>
作者:老虎沒打到
 
上海亞威原創,轉載請註明出處
 
. 前言:
如今很多公司都想通過比較安全,廉價的方式將各自的總部與分部,辦事處等地方連接起來。而傳統的通過二層的網絡(Layer-2 network)如ISDN或幀中繼,那基本都是要交付非常高的費用。特別是在公司總部與分佈特別多的情況下。
在這種環境中,DM***通過讓公司各個部門在廉價的INTERNET環境中部署,就作爲一個安全,實用,和廉價的解決方案。
並且這種解決方案已經得到廣泛的普及,在CISCO CCIE-安全的考試中也是必考的部分。此操作細解也是針對工作和考試中對於DM***的配置詳細說明。
配置中也基本涉及了考試中涉及的配置命令以及作用,已經說明了如果不配置可能產生的問題。
    並且以模擬器Dynamips模擬器***版做爲實驗環境,其中的配置都是可以通過粘貼方式進行驗證。
 
 
 
. 簡單的技術介紹:
DM***和GRE-OVER-IPSEC非常相似,GRE-OVER-IPSEC的技術原理就是通過隧道方式加密流量。DM***做到了產生點到多點的TUNNEL。以HUB-SPOKE的方式在INTERNET上部署。
 
 
. 知識點分析:
DM***
D: Dynamic代表動態
M: Multipoint代表多點
與傳統的IPSEC***相比,傳統的多點要做IPSEC***擴展性比較小,傳統的IPSEC***中心站點要和分支站點都建立IPSEC***,分支要去分支站點要先去中心站點,在中心站點解祕再加祕送到分支站點,增加了中心站點的路由器消耗。或者做full meshed結構的話,會造成大量的配置。DM***提高了擴展性能的問題。
優點 1:簡單的配置中心點和分支點的full meshed結構(虛擬的full meshed)
     2:支持分支站點動態IP地址,(中心必須固定地址,也不可以用域名)
     3:如果新增加了分支站點,不需要更改中心點配置
     4:分支站點和分支站點通信會動態建立隧道觸發IPSEC,是按需建立的。(相當與動態建立GRE隧道,可以跑路由協議)
     5:支持0丟包(協商的幾個包是由中心站點代轉的,不會丟棄)
     6:支持組播
     7:支持MPLS的VRF
     8:能夠支持中心站點的備份,(相當一個分支與兩個中心站點建立***,當一箇中心站點會了可以馬上進行切換)
     9:支持負載均衡
 
. 技術組成:
技術組成:
1,MGRE:(multipoint GRE)點對多點GRE。
2,NHRP : (Next Hop Resolution Protocol) 下一跳解析協議 作用在用在做多點GRE的時候,把物理地址和GRE的邏輯地址相互影射,中心站點相當與NHRP的服務器(NHS),當分支站點要與分支站點通信時候,會請求中心站點詢問分支站點的物理地址和邏輯地址的影射,中心會去詢問分支站點的NHRP,然後迴應,那麼兩個分支站點就會有相互的物理地址和GRE邏輯地址的相互影射,就可以通信了。
3,Dynamic Routing Protocol: 因爲有GRE在,所以分支站點會和中心站點建立鄰居。中心站點會和分支站點建立鄰居,但是分支站點和分支站點是沒有鄰居關係的。在中心站點上會有分支站點的路由,而分支站點和分支站點間沒有相互的路由,分支要從中心才能學習到分支路由。路由更新和組播只在分支點和中心點進行傳播。*單播包可以穿越分支站點和分支站點動態建立的隧道,而路由更新包和組播包不能在分支站點上直接傳輸,必須通過中心站點傳輸*。
4,IPSec *** :流量加密。
 
 
五.配置介紹:Dynamips-***版

R1(分支站點)
R2(中心站點)
R3(分支站點)
預配
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
interface FastEthernet0/0
 ip address 10.1.123.1 255.255.255.0
預配
interface Loopback0
 ip address 2.2.2.2 255.255.255.255      
interface FastEthernet0/0
 ip address 10.1.123.2 255.255.255.0
預配
interface Loopback0
 ip address 3.3.3.3 255.255.255.255       
interface FastEthernet0/0
 ip address 10.1.123.3 255.255.255.0
配置中心站點的MGRE+NHRP:步驟2
interface Tunnel0
 ip address 100.1.123.1 255.255.255.0
ip nhrp authentication cisco   (由於NHRP服務端使用認證,分支也必須使用)
 ip nhrp map 100.1.123.2 10.1.123.2   (要到NHRP中心站點去註冊,必須要有中心站點的手動影射,將GRE多點地址和中心站點的物理地址做影射) 
 ip nhrp map multicast 10.1.123.2   (將組播流量轉成單播,送到中心站點去,寫中心站點的物理地址)
 ip nhrp network-id 10   (必須和中心站點相同)
 ip nhrp nhs 100.1.123.2   (分支站點需要知道NHS的服務器的地址,要寫GRE的地址)
tunnel source FastEthernet0/0
 tunnel mode gre multipoint
 tunnel key 123   (由於中心點寫了,分支也要寫)
配置中心站點的MGRE+NHRP:步驟1
interface Tunnel0   (直接啓動tunnel0的話,默認是點對點的tunnel)
 ip address 100.1.123.2 255.255.255.0
ip nhrp authentication cisco   (用於NHRP認證)
 ip nhrp map multicast dynamic   (比如動態路由協議大多用組播建立鄰居,那麼就需要把組播地址也進行影射,由於中心站點並不知道分支站點的物理地址,所以通過動態學習的方式學習,要在起NHRP註冊前敲,如果出現問題要在中心點shutdown和no shutdown)
 ip nhrp network-id 10   (啓動NHRP,這個ID相當與起了NHRP的進程,每個分支和中心點要起相同的ID)
tunnel source FastEthernet0/0  (多點GRE的特點是有源沒有目的的)
 tunnel mode gre multipoint   (將tunnel模式改成多點GRE)
 tunnel key 123   (在12.3的老版本的時候不敲的話tunnel是不會up的,在12.4的時候是沒有關係的,可以不敲。作用在於在一個設備上可以建立多個多點GRE,是用來區分使用,新版本可選)
配置中心站點的MGRE+NHRP:步驟3
這個分支站點的配置和R1一樣
interface Tunnel0
 ip address 100.1.123.3 255.255.255.0
 ip nhrp authentication cisco
 ip nhrp map 100.1.123.2 10.1.123.2
 ip nhrp map multicast 10.1.123.2
 ip nhrp network-id 10
 ip nhrp nhs 100.1.123.2
 tunnel source FastEthernet0/0
 tunnel mode gre multipoint
 tunnel key 123
驗證NHRP是否成功
R1#show ip nhrp
100.1.123.2/32 via 100.1.123.2, Tunnel0 created 00:21:27, never expire
 Type: static, Flags: nat used
 NBMA address: 10.1.123.2
驗證NHRP是否成功
R2#show ip nhrp
100.1.123.1/32 via 100.1.123.1, Tunnel0 created 00:17:04, expire 01:42:55
 Type: dynamic, Flags: unique nat registered
 NBMA address: 10.1.123.1
100.1.123.3/32 via 100.1.123.3, Tunnel0 created 00:06:14, expire 01:53:45
 Type: dynamic, Flags: unique nat registered
 NBMA address: 10.1.123.3
 
驗證NHRP是否成功
R3#show ip nhrp
100.1.123.2/32 via 100.1.123.2, Tunnel0 created 00:09:53, never expire
 Type: static, Flags: nat used
 NBMA address: 10.1.123.2
測試多點GRE連通性
R1#ping 100.1.123.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.123.3, timeout is 2 seconds:
!.!!!
(第一個包是由中轉,第二個包因爲要解析,所以會丟一個包)
 
測試多點GRE連通性
R3#ping 100.1.123.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.123.1, timeout is 2 seconds:
!!!!!
配置動態路由協議
router eigrp 100
 network 1.1.1.1 0.0.0.0
 network 100.1.123.0 0.0.0.255
 no auto-summary
注意宣告多點GRE的地址,不宣告物理地址
 
配置動態路由協議
router eigrp 100
 network 2.2.2.2 0.0.0.0
 network 100.1.123.0 0.0.0.255
 no auto-summary
注意宣告多點GRE的地址,不宣告物理地址
 
配置動態路由協議
router eigrp 100
 network 3.3.3.3 0.0.0.0
 network 100.1.123.0 0.0.0.255
 no auto-summary
注意宣告多點GRE的地址,不宣告物理地址
 
驗證:
show ip eigrp neighbors
學到中心的鄰居
Show ip rotute
學到中心點的路由
 
驗證:
show ip eigrp neighbors
學到兩個分支站點的鄰居
Show ip rotute
學到所有路由
 
驗證:
show ip eigrp neighbors
學到中心的鄰居
Show ip rotute
學到中心點的路由
 
 
由於在tunnel下有水平分割的問題,所以要在tunnel口下關閉eigrp的水平分割問題,讓兩個分支站點學到相互的路由
interface Tunnel0
no ip split-horizon eigrp 100
 
 
驗證:
R1#show ip route
     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/297372416] via 100.1.123.2, 00:14:37, Tunnel0
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.123.0 is directly connected, Tunnel0
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/310172416] via 100.1.123.2, 00:02:10, Tunnel0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.123.0 is directly connected, FastEthernet0/0
 
 
驗證:
R3#show ip route
     1.0.0.0/32 is subnetted, 1 subnets
D       1.1.1.1 [90/310172416] via 100.1.123.2, 00:03:23, Tunnel0
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/297372416] via 100.1.123.2, 00:14:48, Tunnel0
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.123.0 is directly connected, Tunnel0
     3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.123.0 is directly connected, FastEthernet0/0
 
 
在上步中發現,兩個分支站點還是通過中心點轉發路由,要解決這個問題
interface Tunnel0
no ip next-hop-self eigrp 100
 
 
驗證:
R1#show ip route
     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/297372416] via 100.1.123.2, 00:01:49, Tunnel0
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.123.0 is directly connected, Tunnel0
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/310172416] via 100.1.123.3, 00:01:47, Tunnel0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.123.0 is directly connected, FastEthernet0/0
 
驗證:
R3#show ip route
     1.0.0.0/32 is subnetted, 1 subnets
D       1.1.1.1 [90/310172416] via 100.1.123.1, 00:02:17, Tunnel0
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/297372416] via 100.1.123.2, 00:02:17, Tunnel0
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.123.0 is directly connected, Tunnel0
     3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.123.0 is directly connected, FastEthernet0/0
 
配置IPSEC***
crypto isakmp policy 10
 authentication pre-share
crypto isakmp key cisco address 0.0.0.0 0.0.0.0
 
crypto ipsec transform-set cisco esp-3des esp-md5-hmac
 mode transport
crypto ipsec profile prof
 set transform-set cisco
配置IPSEC***
crypto isakmp policy 10
 authentication pre-share
crypto isakmp key cisco address 0.0.0.0 0.0.0.0
 
crypto ipsec transform-set cisco esp-3des esp-md5-hmac
 mode transport
crypto ipsec profile prof
 set transform-set cisco
配置IPSEC***
crypto isakmp policy 10
 authentication pre-share
crypto isakmp key cisco address 0.0.0.0 0.0.0.0
 
crypto ipsec transform-set cisco esp-3des esp-md5-hmac
 mode transport
crypto ipsec profile prof
 set transform-set cisco
接口調用
interface Tunnel0
ip mtu 1400  (隧道默認是1500,但是從物理口出去,物理口也是1500,但是由於會加祕會多幾個字節,MTU改成1400可以防止分片)
tunnel protection ipsec profile prof
 
接口調用
interface Tunnel0
ip mtu 1400
tunnel protection ipsec profile prof
 
接口調用
interface Tunnel0
ip mtu 1400
tunnel protection ipsec profile prof
 
驗證
R1#ping 3.3.3.3 so lo 0 re 100
驗證
Show ip eigrp 100 nei
Show crypto ipsec sa
 
 
 
 
 
 
 
 
 
. 結束語、下週預告、聯繫方式:
 
任何技術有爭論纔有學習和進步,當然是在文明用語的前提下,所以大家如果有疑問的地方,或者你覺得我說錯了,有哪些地方需要改經,可以在我的微薄留言,或者直接qq聯繫我,我如果看到了一定一一給大家回覆。
 
 
聯繫方式:
官方主頁:www.ccxx.com.cn
QQ1395298216
郵箱:[email protected]
官方技術連載微博:
主要交流微博
  
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章