hcip的mgre和ospf实验

题目

拓扑图

hcip的mgre和ospf实验_第1张图片

一、配置环回和IP地址

R1

< Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r1
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 64.1.1.1 24
Aug 4 2023 18:56:07-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r1-GigabitEthernet0/0/1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 14.1.1.1 24
Aug 4 2023 18:56:27-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]q
[r1]int lo
[r1]int LoopBack 0
[r1-LoopBack0]ip add 1.1.1.1 24

R2

< Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 24.1.1.1 24
Aug 4 2023 18:56:56-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r2-GigabitEthernet0/0/0]q
[r2]int lo
[r2]int LoopBack 0
[r2-LoopBack0]ip add 2.2.2.2 24

R3

< Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 34.1.1.1 24
Aug 4 2023 18:57:15-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]q
[r3]int lo
[r3]int LoopBack 0
[r3-LoopBack0]ip add 3.3.3.3 24

R4

< Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 44.1.1.1 24
Aug 4 2023 18:57:38-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r4-GigabitEthernet0/0/0]q
[r4]int lo
[r4]int LoopBack 0
[r4-LoopBack0]ip add 4.4.4.4 24

R5

< Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r5
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 54.1.1.1 24
Aug 4 2023 18:58:00-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r5-GigabitEthernet0/0/0]q
[r5]int lo
[r5]int LoopBack 0
[r5-LoopBack0]ip add 5.5.5.5 24

R6

< Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r6
[r6]int g2/0/0
[r6-GigabitEthernet2/0/0]ip add 34.1.1.2 24
Aug 4 2023 18:58:28-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet2/0/0 has entered the UP state.
[r6-GigabitEthernet2/0/0]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 14.1.1.2 24
Aug 4 2023 18:58:45-08:00 r6 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r6-GigabitEthernet0/0/0]int g0/0/1
[r6-GigabitEthernet0/0/1]ip add 64.1.1.2 24
[r6-GigabitEthernet0/0/1]
Aug 4 2023 18:59:23-08:00 r6 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r6-GigabitEthernet0/0/1]int g0/0/2
[r6-GigabitEthernet0/0/2]ip add 24.1.1.2 24
[r6-GigabitEthernet0/0/2]
Aug 4 2023 18:59:35-08:00 r6 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[r6-GigabitEthernet0/0/2]int g4/0/0
[r6-GigabitEthernet4/0/0]ip add 54.1.1.2 24
[r6-GigabitEthernet4/0/0]
Aug 4 2023 18:59:56-08:00 r6 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP
on the interface GigabitEthernet4/0/0 has entered the UP state.
[r6-GigabitEthernet4/0/0]int g3/0/0
[r6-GigabitEthernet3/0/0]ip add 44.1.1.2 24
[r6-GigabitEthernet3/0/0]
Aug 4 2023 19:00:10-08:00 r6 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP
on the interface GigabitEthernet3/0/0 has entered the UP state.
[r6]int lo
[r6]int LoopBack 0
[r6-LoopBack0]ip add 6.6.6.6 24

二、配置缺省

R1

[r1]ip rou
[r1]ip route
[r1]ip route-static 0.0.0.0 0 14.1.1.2
[r1]ip route-static 0.0.0.0 0 64.1.1.2

R2

[r2]ip rou
[r2]ip route
[r2]ip route-static 0.0.0.0 0 24.1.1.2

R3

[r3]ip rou
[r3]ip route
[r3]ip route-static 0.0.0.0 0 34.1.1.2

R4

[r4]ip rou
[r4]ip route
[r4]ip route-static 0.0.0.0 0 44.1.1.2

R5

[r5]ip rou
[r5]ip route
[r5]ip route-static 0.0.0.0 0 54.1.1.2

星型拓扑结构

R1

[r1]int tu
[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]ip add 192.168.4.1 24
[r1-Tunnel0/0/0]tun
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]sou
[r1-Tunnel0/0/0]source 14.1.1.1
Aug 4 2023 19:54:53-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r1-Tunnel0/0/0]
[r1-Tunnel0/0/0]nhrp en
[r1-Tunnel0/0/0]nhrp entry mu
[r1-Tunnel0/0/0]nhrp entry multicast dy
[r1-Tunnel0/0/0]nhrp entry multicast dynamic

R2

[r2]int tun
[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]ip add 192.168.4.2 24
[r2-Tunnel0/0/0]tun
[r2-Tunnel0/0/0]tunnel-protocol gre
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]sour
[r2-Tunnel0/0/0]source g0/0/0
Aug 4 2023 19:56:36-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r2-Tunnel0/0/0]nhrp entry multicast dynamic
[r2-Tunnel0/0/0]nh
[r2-Tunnel0/0/0]nhrp en
[r2-Tunnel0/0/0]nhrp entry 192.168.4.1 14.1.1.1 re
[r2-Tunnel0/0/0]nhrp entry 192.168.4.1 14.1.1.1 register
[r2-Tunnel0/0/0]

R3

[r3]int tun
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 192.168.4.3 24
[r3-Tunnel0/0/0]tun
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]s
[r3-Tunnel0/0/0]sou
[r3-Tunnel0/0/0]source g0/0/0
Aug 4 2023 19:58:08-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3-Tunnel0/0/0]nh
[r3-Tunnel0/0/0]nhrp en
[r3-Tunnel0/0/0]nhrp entry 192.168.4.1 14.1.1.1 re
[r3-Tunnel0/0/0]nhrp entry 192.168.4.1 14.1.1.1 register
[r3-Tunnel0/0/0]

MGRE全连拓扑

R1

[r1]int tun
[r1]int Tunnel 0/0/1
[r1-Tunnel0/0/1]ip add 192.168.5.1 24
[r1-Tunnel0/0/1]tun
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]sou
[r1-Tunnel0/0/1]source 64.1.1.1
Aug 4 2023 21:49:24-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the DOWN state.
[r1-Tunnel0/0/1]
[r1-Tunnel0/0/1]
Aug 4 2023 21:49:24-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[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 dy
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
[r1-Tunnel0/0/1]nh
[r1-Tunnel0/0/1]nhrp en
[r1-Tunnel0/0/1]nhrp entry 192.168.5.2 44.1.1.1 re
[r1-Tunnel0/0/1]nhrp entry 192.168.5.2 44.1.1.1 register
[r1-Tunnel0/0/1]nhrp entry 192.168.5.3 54.1.1.1 register
[r1-Tunnel0/0/1]

R4

[r4]int tun
[r4]int Tunnel 0/0/1
[r4-Tunnel0/0/1]nh
[r4-Tunnel0/0/1]nhrp en
[r4-Tunnel0/0/1]ip add 192.168.5.2 24
[r4-Tunnel0/0/1]tun
[r4-Tunnel0/0/1]tunnel-protocol gre p2mp
[r4-Tunnel0/0/1]sou
[r4-Tunnel0/0/1]source 44.1.1.1
Aug 4 2023 21:53:12-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r4-Tunnel0/0/1]nhrp entry multicast dynamic
[r4-Tunnel0/0/1]nh
[r4-Tunnel0/0/1]nhrp en
[r4-Tunnel0/0/1]nhrp entry 192.168.5.1 64.1.1.1 re
[r4-Tunnel0/0/1]nhrp entry 192.168.5.1 64.1.1.1 register
Info: This peer protocol address conflicts with hub register peer protocol addre
ss.
[r4-Tunnel0/0/1]nhrp entry 192.168.5.3 54.1.1.1 register
[r4-Tunnel0/0/1]

R5

[r5]
[r5]int tun
[r5]int Tunnel 0/0/1
[r5-Tunnel0/0/1]ip add 192.168.5.3 24
[r5-Tunnel0/0/1]tun
[r5-Tunnel0/0/1]tunnel-protocol gre p2mp
[r5-Tunnel0/0/1]sou
[r5-Tunnel0/0/1]source 54.1.1.1
Aug 4 2023 21:54:27-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r5-Tunnel0/0/1]nhrp entry multicast dynamic
[r5-Tunnel0/0/1]nh
[r5-Tunnel0/0/1]nhrp en
[r5-Tunnel0/0/1]nhrp entry 192.168.5.1 64.1.1.1 re
[r5-Tunnel0/0/1]nhrp entry 192.168.5.1 64.1.1.1 register
[r5-Tunnel0/0/1]nhrp entry 192.168.5.2 44.1.1.1 register
Info: This peer protocol address conflicts with hub register peer protocol addre
ss.
[r5-Tunnel0/0/1]

ospf配置

R1

[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.5.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.4.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0

R2

[r2]ospf 1 rou
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]ar
[r2-ospf-1]area 0
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]net
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 192.168.4.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]q
[r2-ospf-1]q
[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]ospf network-type p2mp

R3

[r3]ospf 1 rou
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]ar
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]net
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 192.168.5.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 192.168.4.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]q
[r3-ospf-1]q
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ospf network-type p2mp

R4

[r4]ospf 1 rou
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]ar
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]net
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 192.168.5.2 0.0.0.0
[r4-ospf-1-area-0.0.0.0]q
[r4-ospf-1]q
[r4]int Tunnel 0/0/1
[r4-Tunnel0/0/1]ospf network-type broadcast

R5

[r5]ospf 1 rou
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]ar
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]net
[r5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 192.168.5.3 0.0.0.0
[r5-ospf-1-area-0.0.0.0]q
[r5-ospf-1]q
[r5]int Tunnel 0/0/1
[r5-Tunnel0/0/1]ospf network-type broadcast

检验,用R1去ping R2,R3,R4,R5的环回,能ping通则成功
hcip的mgre和ospf实验_第2张图片
hcip的mgre和ospf实验_第3张图片
hcip的mgre和ospf实验_第4张图片
hcip的mgre和ospf实验_第5张图片
ping R6的环回也成功
hcip的mgre和ospf实验_第6张图片

你可能感兴趣的:(网络,服务器,后端,开发语言)