首先对a0区域进行ip配置
[r3]int s4/0/0
[r3-Serial4/0/0]ip add 34.0.0.1 24
[r3-Serial4/0/0]q
[r3]ip route-static 0.0.0.0 0 34.0.0.2
[r3][ISP]int s4/0/0
[ISP-Serial4/0/0]ip add
[ISP-Serial4/0/0]ip address 34.0.0.2 24
[ISP-Serial4/0/0]
[ISP-Serial4/0/0]int s3/0/0
[ISP-Serial3/0/0]ip add 46.0.0.2 24
[ISP-Serial3/0/0]int s4/0/1
[ISP-Serial4/0/1]ip add 45.0.0.2 24
[ISP-Serial4/0/1]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 47.0.0.2 24
[ISP-GigabitEthernet0/0/0]int l0
[ISP-LoopBack0]ip add 4.4.4.4 24
[ISP-LoopBack0]
其他同上,注意指向ISP的缺省。
对R3 R5 R6 R7进行MRGRE配置,R3为中站点
[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 172.16.1.1 29
[r3-Tunnel0/0/0]tunnel-protocol gre p
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 34.0.0.1
[r3-Tunnel0/0/0]
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3-Tunnel0/0/0]
[r5]int t0/0/0
[r5-Tunnel0/0/0]ip add 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]
[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]
R6,R7 同R5配置。
配置a1,a2,a3,a4的接口IP及环回IP
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 172.16.33.1 29
Apr 14 2023 22:38:54-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]int l0
[r1-LoopBack0]ip add 172.16.34.1 24
[r1-LoopBack0]
:
:
:
[r12]int g0/0/0
[r12-GigabitEthernet0/0/0]ip add 172.16.65.10 29
Apr 14 2023 22:43:46-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 add 172.16.160.1 20
[r12-LoopBack0]int l1
[r12-LoopBack1]ip add 172.16.176.1 20
[r12-LoopBack1]
启动各区域的OSPF
[r1]ospf 1 rou
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]n
[r1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
[r1-ospf-1-area-0.0.0.1]
[r3]ospf 1 rou
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]a 1
[r3-ospf-1-area-0.0.0.1]ne
[r3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.255.255
[r3-ospf-1-area-0.0.0.1]
[r3-ospf-1-area-0.0.0.1]q
[r3-ospf-1]a 0
[r3-ospf-1-area-0.0.0.0]ne
[r3-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0
[r3-ospf-1-area-0.0.0.0]
[r7]ospf 1 rou
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]a 0
[r7-ospf-1-area-0.0.0.0]ne
[r7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.7.255
[r7-ospf-1-area-0.0.0.0]a 3
[r7-ospf-1-area-0.0.0.3]ne
[r7-ospf-1-area-0.0.0.3]network 172.16.9
Apr 14 2023 22:51:31-08:00 r7 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.1.16.172, Neighbo
rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)
[r7-ospf-1-area-0.0.0.3]network 172.16.97.1 0.0.0.0
[r7-ospf-1-area-0.0.0.3]
[r6]ospf 1
[r6]ospf 1 rou
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]a 0
[r6-ospf-1-area-0.0.0.0]ne
[r6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
[r6-ospf-1-area-0.0.0.0]a 2
[r6-ospf-1-area-0.0.0.2]network 172.16.65.1 0.0.0.0
[r6-ospf-1-area-0.0.0.2]
[r12]ospf 1 rou
[r12]ospf 1 router-id 12.12.12.12
[r12-ospf-1]a 2
[r12-ospf-1-area-0.0.0.2]ne
[r12-ospf-1-area-0.0.0.2]network 172.16.65.10 0.0.0.0
[r12-ospf-1-area-0.0.0.2]
[r12]rip 1
[r12-rip-1]v 2
[r12-rip-1]ne
[r12-rip-1]network 172.16.0.0
[r12-rip-1]
更改Tunnel接口的类型
R3
[r3]int t0/0/0
[r3-Tunnel0/0/0]ospf network-type p2mpAR5
[r5]int t0/0/0
[r5-Tunnel0/0/0]ospf network-type p2mpAR6
[r6]int t0/0/0
[r6-Tunnel0/0/0]ospf network-type p2mpAR7
[r7]int t0/0/0
[r7-Tunnel0/0/0]ospf network-type p2mp
在R12上进行重发布
[r12]ospf 1
[r12-ospf-1]imp
[r12-ospf-1]import-route rip 1
[r12-ospf-1]q
pingR1的环回,可以做到全网通
[r12]ping 172.16.34.1
PING 172.16.34.1: 56 data bytes, press CTRL_C to break
Reply from 172.16.34.1: bytes=56 Sequence=1 ttl=252 time=60 ms
Reply from 172.16.34.1: bytes=56 Sequence=2 ttl=252 time=70 ms
Reply from 172.16.34.1: bytes=56 Sequence=3 ttl=252 time=80 ms
Reply from 172.16.34.1: bytes=56 Sequence=4 ttl=252 time=60 ms
Reply from 172.16.34.1: bytes=56 Sequence=5 ttl=252 time=60 ms--- 172.16.34.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 60/66/80 ms
下面进行优化
·对ABR和ASBR做空接口来防止环路
[r3]ip rou
[r3]ip route
[r3]ip route-static 172.16.32.0 19 n
[r3]ip route-static 172.16.32.0 19 NULL 0
[r3]
[r6]ip rou
[r6]ip route
[r6]ip route-static 172.16.64.0 19 n
[r6]ip route-static 172.16.64.0 19 NULL 0
[r6]
[r7]ip rou
[r7]ip route
[r7]ip route-static 172.16.96.0 19 n
[r7]ip route-static 172.16.96.0 19 NULL 0
[r7]
[r9]ip rou
[r9]ip route
[r9]ip route-static 172.16.128.0 19 n
[r9]ip route-static 172.16.128.0 19 NULL 0
[r9]
[r12]ip rou
[r12]ip route
[r12]ip route-static 172.16.160 19 n
[r12]ip route-static 172.16.160 19 n
[r12]ip route-static 172.16.160.0 19 n
[r12]ip route-static 172.16.160.0 19 NULL 0
[r12]
·对a1区域进行区域认证配置,保障更新安全
[r1]ospf 1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]auth
[r1-ospf-1-area-0.0.0.1]authentication-mode md5 1 ci
[r1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r1-ospf-1-area-0.0.0.1]
[r2]ospf 1
[r2-ospf-1]a 1
[r2-ospf-1-area-0.0.0.1]au
[r2-ospf-1-area-0.0.0.1]authentication-mode m
[r2-ospf-1-area-0.0.0.1]authentication-mode md5 1 c
[r2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r2-ospf-1-area-0.0.0.1]
[r3]ospf 1
[r3-ospf-1] a 1
[r3-ospf-1-area-0.0.0.1]au
[r3-ospf-1-area-0.0.0.1]authentication-mode m
[r3-ospf-1-area-0.0.0.1]authentication-mode md5
OSPF实验主要是配置太多,要保持头脑清晰,先规划再分步配置。