IT评测·应用市场-qidao123.com
标题:
OSPF综合实验
[打印本页]
作者:
小秦哥
时间:
2024-7-18 09:01
标题:
OSPF综合实验
一、实验拓扑及要求
二、过程
(一)R4为ISP,其上只能设置IP地址;R4与其他所有直连设备间均利用公有IP
1、设置IP地址
(1)R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip address 172.16.17.1 24
[R1-GigabitEthernet0/0/0]
Jul 16 2024 21:47:18-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]int l0
[R1-LoopBack0]ip address 172.16.17.1 24
复制代码
(2)R2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip ad 172.16.16.2 29
Jul 16 2024 21:48:21-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r2-GigabitEthernet0/0/0]int l0
[r2-LoopBack0]ip ad 172.16.18.1 24
复制代码
(3)R3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip ad 172.16.16.3 29
Jul 16 2024 21:49:56-08:00 r3 %%01IFNET/4/LINK_STATE(l)[6]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]int l0
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip ad 172.16.16.3 29
Jul 16 2024 21:51:43-08:00 r3 %%01IFNET/4/LINK_STATE(l)[8]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]int l0
[r3-LoopBack0]ip ad 172.16.19.1 24
[r3-LoopBack0]int s4/0/0
[r3-Serial4/0/0]ip ad 34.0.0.3 24
复制代码
(4)R4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip ad 47.0.0.4 24
Jul 16 2024 21:53:49-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]int s4/0/0
[r4-Serial4/0/0]ip ad 34.0.0.4 24
[r4-Serial4/0/0]
Jul 16 2024 21:54:22-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
[r4-Serial4/0/0]int s4/0/1
[r4-Serial4/0/1]ip ad 45.0.0.4 24
[r4-Serial4/0/1]int s3/0/0
[r4-Serial3/0/0]ip ad 46.0.0.4 24
[r4-Serial3/0/0]int l0
[r4-LoopBack0]ip ad 4.4.4.4 32
复制代码
(5)R5
[r5]int s4/0/0
[r5-Serial4/0/0]ip ad 45.0.0.5 24
Jul 16 2024 21:56:33-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]int l0
[r5-LoopBack0]ip ad 172.16.1.1 24
复制代码
(6)R6
[r6]int s4/0/0
[r6-Serial4/0/0]ip ad 46.0.0.6 24
[r6-Serial4/0/0]
Jul 16 2024 21:57:24-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 g0/0/0
[r6-GigabitEthernet0/0/0]ip ad 172.16.33.1 30
[r6-GigabitEthernet0/0/0]
Jul 16 2024 21:57:43-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 l0
[r6-LoopBack0]ip ad 172.16.2.1 24
复制代码
(7)R7
[r7]int g0/0/0
[r7-GigabitEthernet0/0/0]int l0
[r7-LoopBack0]ip ad 172.16.3.1 24
[r7-LoopBack0]int g0/0/1
[r7-GigabitEthernet0/0/1]ip ad 172.16.49.1 30
Jul 16 2024 21:59:50-08:00 r7 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
复制代码
(8)R8
[r8]int g0/0/0
[r8-GigabitEthernet0/0/0]ip ad 172.16.49.2 30
Jul 16 2024 22:00:57-08:00 r8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r8-GigabitEthernet0/0/0]int g0/0/1
[r8-GigabitEthernet0/0/1]ip ad 172.16.49.5 30
Jul 16 2024 22:01:26-08:00 r8 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r8-GigabitEthernet0/0/1]int l0
[r8-LoopBack0]ip ad 172.16.48.1 24
[r8-LoopBack0]q
复制代码
(9)R9
[r9]int g0/0/0
[r9-GigabitEthernet0/0/0]ip ad 172.16.49.6 30
Jul 16 2024 22:03:20-08:00 r9 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r9-GigabitEthernet0/0/0]int l0
[r9-LoopBack0]ip ad 172.16.64.1 24
[r9-LoopBack0]int g0/0/1
[r9-GigabitEthernet0/0/1]ip ad 172.16.66.1 30
[r9-GigabitEthernet0/0/1]
Jul 16 2024 22:04:02-08:00 r9 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
复制代码
(10)R10
[R10]int g 0/0/0
[R10-GigabitEthernet0/0/0]ip ad 172.16.66.2 30
[R10-GigabitEthernet0/0/0]int l0
[R10-LoopBack0]ip ad 172.16.65.1 24
复制代码
(11)R11
[r11]int g0/0/0
[r11-GigabitEthernet0/0/0]ip ad 172.16.33.2 30
[r11-GigabitEthernet0/0/0]
Jul 16 2024 22:06:10-08:00 r11 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r11-GigabitEthernet0/0/0]int g0/0/1
[r11-GigabitEthernet0/0/1]ip ad 172.16.33.5 30
Jul 16 2024 22:06:31-08:00 r11 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r11-GigabitEthernet0/0/1]int l0
[r11-LoopBack0]ip ad 172.16.32.1 24
复制代码
(12)R12
[r12]int g0/0/0
[r12-GigabitEthernet0/0/0]
[r12-GigabitEthernet0/0/0]ip ad 172.16.33.6 30
[r12-GigabitEthernet0/0/0]
Jul 16 2024 22:07:41-08:00 r12 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r12-GigabitEthernet0/0/0]int l0
[r12-LoopBack0]ip ad 172.16.128.1 18
[r12-LoopBack0]int l1
[r12-LoopBack1]ip ad 172.16.192.1 18
复制代码
(二)R3-R5/6/7为MGRE环境,R3为中心站点;
1、设置R3/5/6/7的缺省路由,全网可通
(1)R3
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip ad 172.16.0.1 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 34.0.0.3
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3-Tunnel0/0/0]ip route-static 0.0.0.0 34.0.0.4
复制代码
(2)R5
[r5]int t 0/0/0
[r5-Tunnel0/0/0]ip ad 172.16.0.2 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source Serial 4/0/0
Jul 16 2024 22:15:12-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.0.1 34.0.0.3 register
[r5-Tunnel0/0/0]q
[r5]ip route-static 0.0.0.0 0 45.0.0.4
复制代码
(3)R6,R7
[r6]ip route-static 0.0.0.0 0 46.0.0.2
[r7]ip route-static 0.0.0.0 0 47.0.0.2
复制代码
2、配MGRE
(1)R3
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 172.16.1.1 29
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 34.0.0.1
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3-Tunnel0/0/0]ospf network-type p2mp
复制代码
(2)R5
[r5]int Tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 172.16.1.2 29
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source Serial 4/0/0
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
[r5-Tunnel0/0/0]ospf network-type p2mp
复制代码
(3)R6
[r6]int Tunnel 0/0/0
[r6-Tunnel0/0/0]ip address 172.16.1.3 29
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]source Serial 4/0/0
[r6-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
[r6-Tunnel0/0/0]ospf network-type p2mp
复制代码
(4)R7
[r7]int Tunnel 0/0/0
[r7-Tunnel0/0/0]ip address 172.16.1.4 29
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp
[r7-Tunnel0/0/0]nhrp network-id 100
[r7-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r7-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
[r7-Tunnel0/0/0]ospf network-type p2mp
复制代码
(三)整个OSPF环境IP基于172.16.0.0/16分别;
1、area 0
(1)R3
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]net
[r3-ospf-1-area-0.0.0.0]network 172.16.0.1 0.0.0.0
[r3-ospf-1-area-0.0.0.0]int t0/0/0
[r3-Tunnel0/0/0]ospf network-type p2mp
[r3-Tunnel0/0/0]ospf timer hello 1
复制代码
(2)R5
[r5-Tunnel0/0/0]ospf network-type p2mp
[r5-Tunnel0/0/0]o
[r5-Tunnel0/0/0]os
[r5-Tunnel0/0/0]ospf t
[r5-Tunnel0/0/0]ospf net
[r5-Tunnel0/0/0]ospf network-type p
[r5-Tunnel0/0/0]ospf ti
[r5-Tunnel0/0/0]ospf timer h
[r5-Tunnel0/0/0]ospf timer hello 1
复制代码
(3)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.0.3 0.0.0.0
[r6-ospf-1-area-0.0.0.0]network 172.16.2.1 0.0.0.0
[r6-ospf-1-area-0.0.0.0]int t0/0/0
[r6-Tunnel0/0/0]ospf network-type p2mp
[r6-Tunnel0/0/0]ospf timer hello 1
复制代码
(4)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.0.0 0.15.255.255
[r7-ospf-1-area-0.0.0.0]int t0/0/0
[r7-Tunnel0/0/0]ospf network-type p2mp
[r7-Tunnel0/0/0]ospf timer hello 1
复制代码
2、area 1的
(1)R1
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 0.0.0.0 255.255.255.255
[R1-ospf-1-area-0.0.0.1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf timer hello 1
复制代码
(2)R2
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 0.0.0.0 255.255.255.255
[r2-ospf-1-area-0.0.0.1]int g0/0/0
[r2-GigabitEthernet0/0/0]ospf timer hello 1
复制代码
(3)R3
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 172.16.16.0 0.15.255.255
[r3-ospf-1-area-0.0.0.1]int g0/0/0
[r3-GigabitEthernet0/0/0]ospf timer hello 1
复制代码
3、area 2的
(1)R6
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]network 172.16.33.1 0.0.0.0
[r6-ospf-1-area-0.0.0.2]int g0/0/0
[r6-GigabitEthernet0/0/0]ospf timer hello 1
复制代码
(2)R11
[r11]ospf 1 router-id 11.11.11.11
[r11-ospf-1]area 2
[r11-ospf-1-area-0.0.0.2]network 0.0.0.0 255.255.255.255
[r11-ospf-1-area-0.0.0.2]int g0/0/0
[r11-GigabitEthernet0/0/0]ospf timer hello 1
[r11-GigabitEthernet0/0/0]int g0/0/1
[r11-GigabitEthernet0/0/1]ospf timer hello 1
复制代码
(3)R12
[r12]ospf 2 router-id 12.12.12.12
[r12-ospf-2]area 2
[r12-ospf-2-area-0.0.0.2]network 172.16.33.6 0.0.0.0
[r12-ospf-2-area-0.0.0.2]int g0/0/0
[r12-GigabitEthernet0/0/0]ospf timer hello 1
复制代码
4、area 3的
(1)R7
[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]network 172.16.49.1 0.0.0.0
[r7-ospf-1-area-0.0.0.3]int g0/0/1
[r7-GigabitEthernet0/0/1]ospf timer hello 1
复制代码
(2)R8
[r8]ospf 1 router-id 8.8.8.8
[r8-ospf-1]area 3
[r8-ospf-1-area-0.0.0.3]network 0.0.0.0 255.255.255.255
[r8-ospf-1-area-0.0.0.3]int g0/0/0
[r8-GigabitEthernet0/0/0]ospf timer hello 1
[r8-GigabitEthernet0/0/0]int g0/0/1
[r8-GigabitEthernet0/0/1]ospf timer hello 1[r8-GigabitEthernet0/0/0]int g0/0/1
[r8-GigabitEthernet0/0/1]ospf timer hello 1
复制代码
5、area 4的
(1)R9
[r9]ospf 2 router-id 9.9.9.9
[r9-ospf-2]area 4
[r9-ospf-2-area-0.0.0.4]network 172.16.64.0 0.15.255.255
[r9-ospf-2-area-0.0.0.4]int g0/0/0
[r9-GigabitEthernet0/0/0]ospf timer hello 1
复制代码
(2)R10
[R10]ospf 1 router-id 10.10.10.10
[R10-ospf-1]area 4
[R10-ospf-1-area-0.0.0.4]network 0.0.0.0 255.255.255.255
[R10-ospf-1-area-0.0.0.4]int g0/0/0
[R10-GigabitEthernet0/0/0]ospf timer hello 1
复制代码
6、R9/R12重发布
R9
[r9]ospf 1
[r9-ospf-1]import-route rip 1
[r9-ospf-1]q
[r9]rip 1
[r9-rip-1]import-route ospf 1
R12
[r12]ospf 1
[r12-ospf-1]import-route rip 1
[r12-ospf-1]q
[r12]rip 1
[r12-rip-1]import-route ospf 1
复制代码
7、OSPF的路由汇总
(1)R3
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.16.0 255.255.240.0
复制代码
(2)R6
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]abr-summary 172.16.32.0 255.255.240.0
复制代码
(3)R7
[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]abr-summary 172.16.48.0 255.255.240.0
复制代码
(4)R9
[r9]ospf 1
[r9-ospf-1]asbr-summary 172.16.64.0 255.255.240.0
复制代码
(5)R12
[r12]ospf 1
[r12-ospf-1]asbr-summary 172.16.128.0 255.255.128.0
复制代码
为area 1、area 2、area 3做特殊区域
1、area 1的完全末梢区域
R1
[r1]ospf 1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]stub
R2
[r2]ospf 1
[r2-ospf-1]a 1
[r2-ospf-1-area-0.0.0.1]stub
R3
[r3]ospf 1
[r3-ospf-1]a 1
[r3-ospf-1-area-0.0.0.1]stub no-summary
复制代码
2、area 2 的非完全末梢区域
R6
[r6]ospf 1
[r6-ospf-1]a 2
[r6-ospf-1-area-0.0.0.2]nssa no-summary
R11
[r11]ospf 1
[r11-ospf-1]a 2
[r11-ospf-1-area-0.0.0.2]nssa
R12
[r12]ospf 1
[r12-ospf-1]a 2
[r12-ospf-1-area-0.0.0.2]nssa
复制代码
3、area 3的非完全末梢区域
R7
[r7]ospf 1
[r7-ospf-1]a 3
[r7-ospf-1-area-0.0.0.3]nssa no-summary
R8
[r8]ospf 1
[r8-ospf-1]a 3
[r8-ospf-1-area-0.0.0.3]nssa
R9
[r9]ospf 1
[r9-ospf-1]a 3
[r9-ospf-1-area-0.0.0.3]nssa
[r9-ospf-1-area-0.0.0.3]ospf 2
[r9-ospf-2]default-route-advertise
复制代码
设置NAT
R3
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r3-acl-basic-2000]q
[r3]int Serial 4/0/0
[r3-Serial4/0/0]nat outbound 2000
R6
[r6]acl 2000
[r6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r6-acl-basic-2000]q
[r6]int Serial 4/0/0
[r6-Serial4/0/0]nat outbound 2000
R7
[r7]acl 2000
[r7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r7-acl-basic-2000]q
[r7]int GigabitEthernet 0/0/0
[r7-GigabitEthernet0/0/0]nat outbound 2000
复制代码
加快收敛
R3
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ospf timer hello 10
R5
[r5]int t 0/0/0
[r5-Tunnel0/0/0]ospf timer hello 10
R6
[r6]int t 0/0/0
[r6-Tunnel0/0/0]ospf timer hello 10
R7
[r7]int t 0/0/0
[r7-Tunnel0/0/0]ospf timer hello 10
复制代码
OSPF认证
R1
[r1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
R2
[r2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
R3
[r3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
R5
[r5-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
R6
[r6-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
[r6-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123456
R7
[r7-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
[r7-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123456
R8
[r8-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123456
R9
[r9-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123456
[r9-ospf-2-area-0.0.0.4]authentication-mode md5 1 cipher 123456
R10
[r10-ospf-1-area-0.0.0.4]authentication-mode md5 1 cipher 123456
R11
[r11-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123456
R12
[r12-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
复制代码
全网通
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
欢迎光临 IT评测·应用市场-qidao123.com (https://dis.qidao123.com/)
Powered by Discuz! X3.4