1.所有路由接口配置ip,1-5环回配置私有ip,然后1-5缺省全部指向6。
2.做r1,r2,r3之间的中心到站点的星型mgre。
[r1-Tunnel0/0/0]ip add 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 16.1.1.1 (物理接口)
[r1-Tunnel0/0/0]nhrp entry multicast dynamic (定义中心站点)
[r1-Tunnel0/0/0]nhrp network-id 100 (创建注册id r2r3找r1注册从而知道2 , 3的物理接口ip)
[r2-Tunnel0/0/0]ip add 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source GigabitEthernet 0/0/0 (ip可变)
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 16.1.1.1 register (找r1注册)
[r2-Tunnel0/0/0]nhrp network-id 100
3.做r1和r4,r5之间的全连mgre。
[r1-Tunnel0/0/1]ip add 10.1.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 61.1.1.1
[r1-Tunnel0/0/1]nhrp entry 10.1.2.2 56.1.1.1
[r1-Tunnel0/0/1]nhrp entry 10.1.2.3 46.1.1.1 (找 4和5,不用注册,因为是全连)
[r1-Tunnel0/0/1]nhrp network-id 100
[r4-Tunnel0/0/0]ip add 10.1.2.3 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source 46.1.1.1
[r4-Tunnel0/0/0]nhrp entry 10.1.2.1 61.1.1.1
[r4-Tunnel0/0/0]nhrp entry 10.1.2.2 56.1.1.1
[r4-Tunnel0/0/0]nhrp network-id 100[r5]display nhrp peer all
[r5]display nhrp peer all
4.私有网段使用ospf
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 10.1.2.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
5.给 r1和r2,r3的mgre选DR,不选BDR
<r1>display ospf peer b
[r1]display ospf peer
由于r1的接口工作方式为点到点,只能建一个邻居(先) ,所以要修改r1接口工作方式。
[r1-Tunnel0/0/0]ospf network-type broadcast (3个路由器都要改)
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Tunnel0/0/0 2.2.2.2 Full
0.0.0.0 Tunnel0/0/0 3.3.3.3 Full
----------------------------------------------------------------------------
选DR(由于1和2 3都建立邻居关系了,但2和3相互看不见所以规则应该是r1为DR,r2和r3放弃选举,所以2 和3优先级修改为0)
[r2-Tunnel0/0/0]ospf dr-priority 0
[r3-Tunnel0/0/0]ospf dr-priority 0