实验图及需求
2.配置与分析
1、R6为ISP只能配置IP地址,R1-R5的环回为私有网段
R6为ISP只能配置IP地址,划分网段之后,对每个接口的IP配置如下
R1
[R1]int LoopBack 0
[R1-LoopBack0]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/0]ip address 16.0.0.1 24
[R1-GigabitEthernet0/0/1]ip address 116.0.0.1 24
R2
[R2]int LoopBack 0
[R2-LoopBack0]ip address 192.168.2.1 24
[R2-GigabitEthernet0/0/0]ip address 26.0.0.1 24
R3
[R3]int LoopBack 0
[R3-LoopBack0]ip address 192.168.3.1 24
[R3-GigabitEthernet0/0/0]ip address 36.0.0.1 24
R4
[R4]int LoopBack 0
[R4-LoopBack0]ip address 192.168.4.1 24
[R4-GigabitEthernet0/0/0]ip address 46.0.0.1 24
R5
[R5]int LoopBack 0
[R5-LoopBack0]ip address 192.168.5.1 24
[R5-GigabitEthernet0/0/0]ip address 56.0.0.1 24
3.环回地址
[ISP]int LoopBack 0
[ISP-LoopBack0]ip address 6.6.6.6 24
[ISP-GigabitEthernet0/0/1]ip address 116.0.0.2 24
[ISP-GigabitEthernet0/0/0]ip address 16.0.0.2 24
[ISP-GigabitEthernet2/0/0]ip address 26.0.0.2 24
[ISP-GigabitEthernet3/0/0]ip address 36.0.0.2 24
[ISP-GigabitEthernet4/0/0]ip address 46.0.0.2 24
[ISP-GigabitEthernet0/0/2]ip address 56.0.0.2 24
4.配置各路由器缺省
[R1]ip route-static 0.0.0.0 0 116.0.0.2
[R1]ip route-static 0.0.0.0 0 16.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
[R5]ip route-static 0.0.0.0 0 56.0.0.2
5.设R1、R4、R5为全连的MGRE
R1
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 192.168.6.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 16.0.0.1
[R1-Tunnel0/0/0]nhrp network-id 100
[R1-Tunnel0/0/0]nhrp entry 192.168.6.2 46.0.0.1 register
[R1-Tunnel0/0/0]nhrp entry 192.168.6.3 56.0.0.1 register
R4
[R4]int Tunnel 0/0/0
[R4-Tunnel0/0/0]ip address 192.168.6.2 24
[R4-Tunnel0/0/0]tunnel-protocol gre p2mp
[R4-Tunnel0/0/0]source 46.0.0.1
[R4-Tunnel0/0/0]nhrp network-id 100
[R4-Tunnel0/0/0]nhrp entry 192.168.6.1 16.0.0.1 register
[R4-Tunnel0/0/0]nhrp entry 192.168.6.3 56.0.0.1 register
R5
[R5]int Tunnel 0/0/0
[R5-Tunnel0/0/0]ip address 192.168.6.3 24
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source 56.0.0.1
[R5-Tunnel0/0/0]nhrp network-id 100
[R5-Tunnel0/0/0]nhrp entry 192.168.6.1 16.0.0.1 register
[R5-Tunnel0/0/0]nhrp entry 192.168.6.2 46.0.0.1 registe
6.设R1/R2/R3均为星形拓扑结构,其中R1 为中心站点
[R1]int t
[R1]int Tunnel 0/0/1
[R1-Tunnel0/0/1]ip add
[R1-Tunnel0/0/1]ip address 192.168.7.1 24
[R1-Tunnel0/0/1]tun
[R1-Tunnel0/0/1]tunnel-protocol gre p
[R1-Tunnel0/0/1]tunnel-protocol gre p2mp
[R1-Tunnel0/0/1]sou
[R1-Tunnel0/0/1]source 116.0.0.1
Jul 10 2024 23:57:17-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/1 has entered the UP state.
[R1-Tunnel0/0/1]
[R1-Tunnel0/0/1]nhrp
[R1-Tunnel0/0/1]nhrp n
[R1-Tunnel0/0/1]nhrp network-id 100
[R1-Tunnel0/0/1]nh
[R1-Tunnel0/0/1]nhrp en
[R1-Tunnel0/0/1]nhrp entry mu
[R1-Tunnel0/0/1]nhrp entry multicast d
[R1-Tunnel0/0/1]nhrp entry multicast dynamic
[R2]int Tunnel 0/0/1
[R2-Tunnel0/0/1]ip ad
[R2-Tunnel0/0/1]ip address 192.168.7.2 24
[R2-Tunnel0/0/1]t
[R2-Tunnel0/0/1]tun
[R2-Tunnel0/0/1]tunnel-protocol gre p
[R2-Tunnel0/0/1]tunnel-protocol gre p2mp
[R2-Tunnel0/0/1]nh
[R2-Tunnel0/0/1]nhrp n
[R2-Tunnel0/0/1]nhrp network-id 100
[R2-Tunnel0/0/1]sou
[R2-Tunnel0/0/1]source G
[R2-Tunnel0/0/1]source GigabitEthernet 0/0/0
Jul 10 2024 23:59:21-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/1 has entered the UP state.
[R2-Tunnel0/0/1]
[R2-Tunnel0/0/1]nhrp e
[R2-Tunnel0/0/1]nhrp entry 192.168.7.1 116.0.0.1 re
[R2-Tunnel0/0/1]nhrp entry 192.168.7.1 116.0.0.1 register
[R3]int Tunnel 0/0/1
[R3-Tunnel0/0/1]ip address 192.168.7.3 24
[R3-Tunnel0/0/1]tun
[R3-Tunnel0/0/1]tunnel-protocol gre p
[R3-Tunnel0/0/1]tunnel-protocol gre p2mp
[R3-Tunnel0/0/1]sou
[R3-Tunnel0/0/1]source G
[R3-Tunnel0/0/1]source GigabitEthernet 0/0/0
Jul 11 2024 00:00:41-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/1 has entered the UP state.
[R3-Tunnel0/0/1]
[R3-Tunnel0/0/1]nhrp n
[R3-Tunnel0/0/1]nhrp network-id 100
[R3-Tunnel0/0/1]n
[R3-Tunnel0/0/1]nh
[R3-Tunnel0/0/1]nhrp en
[R3-Tunnel0/0/1]nhrp entry 192.168.7.1 116.0.01 re
[R3-Tunnel0/0/1]nhrp entry 192.168.7.1 116.0.01 register
#检查
[R2]display nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.7.1 32 116.0.0.1 192.168.7.1 static hub
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/1
Created time : 00:02:28
Expire time : --
Number of nhrp peers: 1
7.配置OSPF
[R1]ospf 1rou
[R1]ospf 1 rou
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]are
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[R2]ospf 1
[R2]ospf 1 rou
[R2]ospf 1 router-id 2.2.2.2
Info: The configuration succeeded. You need to restart the OSPF process to valid
ate the new router ID.
[R2-ospf-1]are 0
[R2-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]
Jul 11 2024 00:10:41-08:00 R2 %%01OSPF/4/CONFLICT_ROUTERID_INTF(l)[1]:OSPF Route
r id conflict is detected on interface. (ProcessId=256, RouterId=1.1.1.1, AreaId
=0.0.0.0, InterfaceName=Tunnel0/0/1, IpAddr=2.7.168.192, PacketSrcIp=1.7.168.19
2)
[R2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[R3]ospf 1 rou
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]are
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]net
[R3-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]are
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]
Jul 11 2024 00:13:54-08:00 R5 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=2.6.168.192, Neighb
orEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)
8.更改网络类型
[R1]int t0/0/0
[R1-Tunnel0/0/0]ospf network-type broadcast
[R1-Tunnel0/0/0]int t0/0/1
[R1-Tunnel0/0/1]ospf network-type broadcast
[R2]int t0/0/1
[R2-Tunnel0/0/1]ospf network-type broadcast
[R3-ospf-1]int t0/0/1
[R3-Tunnel0/0/1]ospf network-type broadcast
[R4]int t0/0/0
[R4-Tunnel0/0/0]ospf network-type broadcast
[R5-ospf-1]int t0/0/0
[R5-Tunnel0/0/0]ospf network-type broadcast
9.修改R2和R3的参选接口优先级
[R2-Tunnel0/0/1]int t0/0/1
[R2-Tunnel0/0/1]ospf dr-priority 0
[R3-Tunnel0/0/1]int t0/0/1
[R3-Tunnel0/0/1]ospf dr-priority 0