一,给R1-R5配置IP地址和环回地址
1,在R1上配置IP1,在R1上配置IP
2,在R2上配置IP
3,在R3上配置IP
4,在R4上配置IP
5,在R5上配置IP
6,在R6上配置IP
二,给每个路由器写上缺省路由,使内网都能通信。
[r1]ip route-static 0.0.0.0 0.0.0.0 16.0.0.2
ip route-static 0.0.0.0 0.0.0.0 61.0.0.2
[r2]ip route-static 0.0.0.0 0 26.0.0.2
[r3]ip route-static 0.0.0.0 0 36.0.0.2
[r4]ip route-static 0.0.0.0 0 46.0.0.2
[r4]ip route-static 0.0.0.0 0 56.0.0.2
三,R1/2/3为星型的拓扑结构,R1为中心站点,配置mgre。
1,在R1上配置
interface Tunnel0/0/0 ---创建接口
ip address 192.168.6.1 255.255.255.0 ---配置IP
tunnel-protocol gre p2mp ---选择封装类型
source 16.0.0.1
nhrp network-id 100
nhrp entry multicast dynamic ---开启伪广播
2,在R2上配置
interface Tunnel0/0/0
ip address 192.168.6.2 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
nhrp network-id 100
nhrp entry 192.168.6.1 16.0.0.1 register ---找中心注册
3,在R3上配置
interface Tunnel0/0/0
ip address 192.168.6.3 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
nhrp network-id 100
nhrp entry 192.168.6.1 16.0.0.1 register ---找中心注册
四,R1/4/5为全连的MGRE结构,互为中心和分支。
1,在R1上配置
interface Tunnel0/0/1
ip address 192.168.7.1 255.255.255.0
tunnel-protocol gre p2mp
source 61.0.0.1
nhrp network-id 200
nhrp entry 192.168.7.2 46.0.0.1 register ---找r4注册
nhrp entry 192.168.7.3 56.0.0.1 register ---找r5注册
nhrp entry multicast dynamic
2,在R4上配置
interface Tunnel0/0/1
ip address 192.168.7.2 255.255.255.0
tunnel-protocol gre p2mp
source 46.0.0.1
nhrp entry multicast dynamic
nhrp network-id 100
nhrp entry 192.168.7.2 56.0.0.1 register --- 找r5注册
--- 不用找在找r1进行注册,
3,在R5上配置
interface Tunnel0/0/1
ip address 192.168.7.3 255.255.255.0
tunnel-protocol gre p2mp
source 56.0.0.1
ospf network-type broadcast
nhrp entry multicast dynamic
nhrp network-id 100
---r1和r4已经注册,因为注册是双向的
五,使用osfp协议
r1:
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 192.168.1.0 0.0.0.255
network 192.168.6.0 0.0.0.255
network 192.168.7.0 0.0.0.255
r2:
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 192.168.2.0 0.0.0.255
network 192.168.6.0 0.0.0.255
r3:
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 192.168.3.0 0.0.0.255
network 192.168.6.0 0.0.0.255
r4;
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 192.168.4.0 0.0.0.255
network 192.168.7.0 0.0.0.255
r5:
ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 192.168.5.0 0.0.0.255
network 192.168.7.0 0.0.0.255
给虚拟接口修改网络类型
[r1-Tunnel0/0/0]ospf network-type broadcast
[r1-Tunnel0/0/1]ospf network-type broadcast
[r4-Tunnel0/0/1]ospf network-type broadcast
[r5-Tunnel0/0/1]ospf network-type broadcast
[r2-Tunnel0/0/0]ospf network-type broadcast
[r3-Tunnel0/0/0]ospf network-type broadcast
因为R2和R3的认知不同,所以需要将其放弃选举,将优先级修改为0
[r3-Tunnel0/0/0]ospf dr-priority 0
[r2-Tunnel0/0/0]ospf dr-priority 0
因为R1 ,R4, R5之间互为分支和中心,会自动选择DR和BDR。
六,全网可达