OSPF综合实验

拓扑

分配IP配置环回

R1

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 172.16.0.1 27
Aug 6 2023 19:03:33-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]q
[r1]int LoopBack 0
[r1-LoopBack0]ip add 172.16.1.1 24

R2

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 172.16.0.2 27
Aug 6 2023 19:04:24-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 l0
[r2-LoopBack0]ip add 172.16.2.1 24

R3

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 172.16.0.3 27
Aug 6 2023 19:05:10-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 s4/0/0
[r3-Serial4/0/0]ip add 34.0.0.1 24
[r3-Serial4/0/0]q
[r3]int l0
[r3-LoopBack0]ip add 172.16.3.1 24

R4

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r4
[r4]int s4/0/0
[r4-Serial4/0/0]ip add 34.0.0.2 24
Aug 6 2023 19:11:52-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
[r4-Serial4/0/0]int s3/0/1
[r4-Serial3/0/1]ip add 54.0.0.2 24
[r4-Serial3/0/1]int s3/0/0
[r4-Serial3/0/0]ip add 64.0.0.2 24
[r4-Serial3/0/0]int s4/0/1
[r4-Serial4/0/1]ip add 74.0.0.2 24
[r4-Serial4/0/1]q
[r4]int l0
[r4-LoopBack0]ip add 4.4.4.4 24

R5

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r5
[r5]int s4/0/0
[r5-Serial4/0/0]ip add 54.0.0.1 24
Aug 6 2023 19:14:28-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
[r5-Serial4/0/0]q
[r5]int l0
[r5-LoopBack0]ip add 172.16.5.1 24

R6

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r6
[r6]int s4/0/0
[r6-Serial4/0/0]ip add 64.0.0.1 24
Aug 6 2023 19:15:52-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
[r6-Serial4/0/0]int s4/0/1
[r6-Serial4/0/1]ip add 172.16.0.129 27
[r6-Serial4/0/1]q
[r6]int l0
[r6-LoopBack0]ip add 172.16.6.1 24

R7

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r7
[r7]int s4/0/0
[r7-Serial4/0/0]ip add 74.0.0.1 24
Aug 6 2023 19:17:42-08:00 r7 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
[r7-Serial4/0/0]int s4/0/1
[r7-Serial4/0/1]ip add 172.16.0.33 27
[r7-Serial4/0/1]q
[r7]int l0
[r7-LoopBack0]ip add 172.16.7.1 24

R8

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r8
[r8]int s4/0/0
[r8-Serial4/0/0]ip add 172.16.0.34 27
Aug 6 2023 19:19:49-08:00 r8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
[r8-Serial4/0/0]int s4/0/1
[r8-Serial4/0/1]ip add 172.16.0.65 27
[r8-Serial4/0/1]q
[r8]int l0
[r8-LoopBack0]ip add 172.16.8.1 24

R9

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r9
[r9]int s4/0/0
[r9-Serial4/0/0]ip add 172.16.0.66 27
Aug 6 2023 19:22:20-08:00 r9 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
[r9-Serial4/0/0]int s4/0/1
[r9-Serial4/0/1]ip add 172.16.0.97 27
[r9-Serial4/0/1]q
[r9]int l0
[r9-LoopBack0]ip add 172.16.9.1 24

R10

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r10
[r10]int s4/0/0
[r10-Serial4/0/0]ip add 172.16.0.98 27
Aug 6 2023 19:24:09-08:00 r10 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PP
P IPCP on the interface Serial4/0/0 has entered the UP state.
[r10-Serial4/0/0]q
[r10]int l0
[r10-LoopBack0]ip add 172.16.10.1 24

R11

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r11
[r11]int s4/0/0
[r11-Serial4/0/0]ip add 172.16.0.130 27
Aug 6 2023 19:25:15-08:00 r11 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PP
P IPCP on the interface Serial4/0/0 has entered the UP state.
[r11-Serial4/0/0]int s4/0/1
[r11-Serial4/0/1]ip add 172.16.0.161 27
[r11-Serial4/0/1]q
[r11]int l0
[r11-LoopBack0]ip add 172.16.11.1 24

R12

< Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r12
[r12]int s3/0/1
[r12-Serial3/0/1]ip add 172.16.0.162 27
Aug 6 2023 19:26:50-08:00 r12 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PP
P IPCP on the interface Serial3/0/1 has entered the UP state.
[r12-Serial3/0/1]q
[r12]int l0
[r12-LoopBack0]ip add 10.1.1.1 24
[r12-LoopBack0]int l1
[r12-LoopBack1]ip add 11.11.1.1 24

配置缺省


R1

[r1]ip route-static 0.0.0.0 0 172.16.0.3

R2

[r2]ip route-static 0.0.0.0 0 172.16.0.3

R3

[r3]ip route-static 0.0.0.0 0 34.0.0.2

R5

[r5]ip route-static 0.0.0.0 0 54.0.0.2

R6

[r6]ip route-static 0.0.0.0 0 64.0.0.2

R7

[r7]ip route-static 0.0.0.0 0 74.0.0.2

R8

[r8]ip route-static 0.0.0.0 0 172.16.0.33

R9

[r9]ip route-static 0.0.0.0 0 172.16.0.65

R10

[r10]ip route-static 0.0.0.0 0 172.16.0.97

R11

[r11]ip route-static 0.0.0.0 0 172.16.0.129

R12

[r12]ip route-static 0.0.0.0 0 172.16.0.161

搭建MGRE环境


R3

[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 172.16.12.1 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 34.0.0.1
Aug 6 2023 19:39:30-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]nhrp network-id 100

R5

[r5]int t0/0/0
[r5-Tunnel0/0/0]ip add 172.16.12.2 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source Serial 4/0/0
Aug 6 2023 19:41:33-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/0]nhrp entry 172.16.12.1 34.0.0.1 register
[r5-Tunnel0/0/0]nhrp network-id 100

R6

[r6]int t0/0/0
[r6-Tunnel0/0/0]ip add 172.16.12.3 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source Serial 4/0/0
Aug 6 2023 19:43:19-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r6-Tunnel0/0/0]nhrp entry 172.16.12.1 34.0.0.1 register
[r6-Tunnel0/0/0]nhrp network-id 100

R7

[r7]int t0/0/0
[r7-Tunnel0/0/0]ip add 172.16.12.4 24
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp
[r7-Tunnel0/0/0]source s4/0/0
Aug 6 2023 19:44:38-08:00 r7 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r7-Tunnel0/0/0]nhrp entry 172.16.12.1 34.0.0.1 register
[r7-Tunnel0/0/0]nhrp network-id 100

启动ospf

R1

[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]network 172.16.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.1]network 172.16.0.1 0.0.0.0

R2

[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 172.16.2.1 0.0.0.0
[r2-ospf-1-area-0.0.0.1]network 172.16.0.2 0.0.0.0

R3

[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 172.16.12.1 0.0.0.0
[r3-ospf-1-area-0.0.0.0]q
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 172.16.0.3 0.0.0.0
[r3-ospf-1-area-0.0.0.1]network 172.16.3.1 0.0.0.0

R5

[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 172.16.5.1 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 172.16.12.2 0.0.0.0

R6

[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 172.16.6.1 0.0.0.0
[r6-ospf-1-area-0.0.0.0]network 172.16.12.3 0.0.0.0
Aug 6 2023 19:55:30-08:00 r6 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.12.16.172, Neighb
orEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)
[r6-ospf-1-area-0.0.0.0]q
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]network 172.16.0.129 0.0.0.0

R7

[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 172.16.7.1 0.0.0.0
[r7-ospf-1-area-0.0.0.0]network 172.16.12.4 0.0.0.0
Aug 6 2023 19:57:02-08:00 r7 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.12.16.172, Neighb
orEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)
[r7-ospf-1-area-0.0.0.0]q
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]network 172.16.0.33 0.0.0.0

R8

[r8]ospf 1 router-id 8.8.8.8
[r8-ospf-1]area 3
[r8-ospf-1-area-0.0.0.3]network 172.16.0.34 0.0.0.0
[r8-ospf-1-area-0.0.0.3]network 172.16.0.65 0.0.0.0
[r8-ospf-1-area-0.0.0.3]network 172.16.8.1 0.0.0.0

R9

[r9]ospf 1 router-id 9.9.9.9
[r9-ospf-1]import-route ospf 2
[r9-ospf-1]area 3
[r9-ospf-1-area-0.0.0.3]network 172.16.0.66 0.0.0.0
[r9-ospf-1-area-0.0.0.3]q
[r9-ospf-1]area 4
[r9-ospf-1-area-0.0.0.4]network 172.16.9.1 0.0.0.0
[r9-ospf-1-area-0.0.0.4]network 172.16.0.9 0.0.0.0

R10

[r10]ospf 1 router-id 10.10.10.10
[r10-ospf-1]area 4
[r10-ospf-1-area-0.0.0.4]network 172.16.10.1 0.0.0.0
[r10-ospf-1-area-0.0.0.4]network 172.16.0.98 0.0.0.0

R11

[r11]ospf 1 router-id 11.11.11.11
[r11-ospf-1]area 2
[r11-ospf-1-area-0.0.0.2]network 172.16.0.130 0.0.0.0
[r11-ospf-1-area-0.0.0.2]network 172.16.0.161 0.0.0.0
[r11-ospf-1-area-0.0.0.2]network 172.16.11.1 0.0.0.0

R12

[r12]ospf 1 router-id 12.12.12.12
[r12-ospf-1]asbr-summary 11.1.0.0 255.255.254.0
[r12-ospf-1]asbr-summary 10.1.0.0 255.255.254.0
[r12-ospf-1]import-route rip 1
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.2]network 172.16.0.162 0.0.0.0
[r12-ospf-1-area-0.0.0.2]q
[r12-ospf-1]q
[r12]rip 1
[r12-rip-1]version 2
[r12-rip-1]network 10.0.0.0
[r12-rip-1]network 11.0.0.0

修改选举

R3

[r3]int t0/0/0

[r3-Tunnel0/0/0]ospf dr-priority 0
[r3-Tunnel0/0/0]ospf network-type broadcast

R5

[r5]int t0/0/0

[r5-Tunnel0/0/0]ospf dr-priority 0

[r5-Tunnel0/0/0]ospf network-type broadcast 

R6

[r6]int t0/0/0
[r6-Tunnel0/0/0]ospf dr-priority 0
[r6-Tunnel0/0/0]ospf network-type broadcast

R7

[r7]int t0/0/0
[r7-Tunnel0/0/0]ospf dr-priority 0
[r7-Tunnel0/0/0]ospf network-type broadcast

汇总

R3

[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.0.0 255.255.255.224
[r3-ospf-1-area-0.0.0.1]q
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]abr-summary 172.16.12.0 255.255.255.0

R7

[r7]ospf 1
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]abr-summary 172.16.12.0 255.255.255.0
[r7-ospf-1-area-0.0.0.0]q
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]abr-summary 172.16.0.32 255.255.255.224
[r7-ospf-1-area-0.0.0.3]nssa no-summary

R9

[r9]ospf 1
[r9-ospf-1]asbr-summary 172.16.0.96 255.255.255.224
[r9-ospf-1]q
[r9]ospf 2
[r9-ospf-2]asbr-summary 172.16.0.32 255.255.255.224

R12

[r12]ospf 1
[r12-ospf-1]asbr-summary 10.1.1.0 255.255.255.0
[r12-ospf-1]asbr-summary 11.1.1.0 255.255.255.0

配置完全末梢区域

R1

[r1]ospf 1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]stub no-summary

R2

[r2]ospf 1
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]stub no-summary

R3

[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]stub no-summary

配置完全nssa

R6

[r6]ospf 1
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]abr-summary 172.16.12.0 255.255.255.0
[r6-ospf-1-area-0.0.0.0]q
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]abr-summary 172.16.0.128 255.255.255.224
[r6-ospf-1-area-0.0.0.2]nssa no-summary

R11

[r11]ospf 1
[r11-ospf-1]area 2
[r11-ospf-1-area-0.0.0.2]nssa

R12

[r12]ospf 1
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.2]nssa


R7

[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]nssa no-summary

R8

[r8]ospf 1
[r8-ospf-1]area 3
[r8-ospf-1-area-0.0.0.3]nssa

R9

[r9]ospf 1
[r9-ospf-1]area 3
[r9-ospf-1-area-0.0.0.3]nssa

配置动态nat

R3

[r3]nat address-group 1 34.0.0.4 34.0.0.5
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.128 0.0.0.31
[r3-acl-basic-2000]q
[r3]int s4/0/0
[r3-Serial4/0/0]nat outbound 2000 address-group 1 no-pat

R5

[r5]nat address-group 1 54.0.0.4 54.0.0.5
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 172.16.5.0 0.0.0.255
[r5-acl-basic-2000]q
[r5]int s4/0/0
[r5-Serial4/0/0]nat outbound 2000 address-group 1 no-pat

R6

[r6]nat add
[r6]nat address-group 1 64.0.0.4 64.0.0.5
[r6]acl 2000
[r6-acl-basic-2000]rule permit source 172.16.6.0 0.0.0.255
[r6-acl-basic-2000]rule permit source 172.16.0.128 0.0.0.31
[r6-acl-basic-2000]rule permit source 10.1.1.0 0.0.0.255
[r6-acl-basic-2000]rule permit source 11.1.1.0 0.0.0.255
[r6-acl-basic-2000]q
[r6]int s4/0/0
[r6-Serial4/0/0]nat outbound 2000 address-group 1 no-pat

R7

[r7]nat address-group 1 74.0.0.4 74.0.0.5
[r7]acl 2000
[r7-acl-basic-2000]rule permit source 172.16.0.32 0.0.0.31
[r7-acl-basic-2000]rule permit source 172.16.0.96 0.0.0.31
[r7-acl-basic-2000]q
[r7]int s4/0/0
[r7-Serial4/0/0]nat outbound 2000 address-group 1 no-pat

防环

R3

[r3]ip route-static 172.16.0.0 16 null 0

R6

[r6]ip route-static 172.16.0.128 27 NULL 0
[r6]ip route-static 172.16.6.0 24 NULL 0

R9

[r9]ip route-static 172.16.0.96 27 NULL 0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值