點對點nhrp+ospf的測試

nhrp技術應用很多,網絡上相關文章比較多,大多采用cisco標準的hub-spoke結構。這樣有個問題,一旦hub點掛掉就會影響到全部。
 
而在實際應用中更多的採用類似點對點的方式建 nhrp tunnel。比較適用於分支機構不是非常多的企業
 
由於手頭設備有限1751+2950。所以只能用子接口來做實驗,網上大多數都用eigrp,這邊協議採用ospf。紅字部分就是ospf協議能起來的關鍵。原因大家可以自己想想,或者動手做一下 :)
這邊之列出r 1的配置,其他router配置都類似
 
r1
 
interface Loopback0
 ip address 1.0.0.1 255.255.255.255
!        
interface Tunnel1
 ip address 192.168.1.1 255.255.255.0
 no ip redirects
 ip nhrp map 192.168.1.2 3.3.3.2
 ip nhrp map 192.168.1.3 3.3.3.3
 ip nhrp map 192.168.1.4 3.3.3.4
 ip nhrp map multicast 3.3.3.2
 ip nhrp map multicast 3.3.3.3
 ip nhrp map multicast 3.3.3.4

 ip nhrp network-id 100
 ip nhrp holdtime 600
 ip nhrp nhs 192.168.1.2
 ip nhrp nhs 192.168.1.3
 ip nhrp nhs 192.168.1.4
ip ospf network broadcast
 ip ospf priority 4

 tunnel source FastEthernet0/0.100
 tunnel mode gre multipoint
 tunnel key 100
 
 
!
interface FastEthernet0/0
 no ip address
 speed auto
 
!        
interface FastEthernet0/0.100
 encapsulation dot1Q 100
 ip address 3.3.3.1 255.255.255.0
!        
interface FastEthernet0/0.111
 encapsulation dot1Q 111
 ip address 10.10.1.1 255.255.255.0
 
 
router ospf 1
 log-adjacency-changes
 network 10.10.1.0 0.0.0.255 area 0
 network 192.168.1.0 0.0.0.255 area 0
 
驗證命令
 
R1#sh ip nhrp
192.168.1.2/32 via 192.168.1.2, Tunnel1 created 1w1d, never expire
  Type: static, Flags: authoritative used
  NBMA address: 3.3.3.2
192.168.1.3/32 via 192.168.1.3, Tunnel1 created 1w1d, never expire
  Type: static, Flags: authoritative used
  NBMA address: 3.3.3.3
192.168.1.4/32 via 192.168.1.4, Tunnel1 created 1w1d, never expire
  Type: static, Flags: authoritative used
  NBMA address: 3.3.3.4
R1#
 
R1#  sh ip route ospf
     10.0.0.0/24 is subnetted, 4 subnets
O       10.10.2.0 [110/11112] via 192.168.1.2, 00:18:29, Tunnel1
O       10.10.3.0 [110/11112] via 192.168.1.3, 00:18:29, Tunnel1
O       10.10.4.0 [110/11112] via 192.168.1.4, 00:18:29, Tunnel1
R1#
 
  
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章