点对点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#
 
  

你可能感兴趣的:(网络,测试,休闲,ospf,NHRP)