问题描述:
说明:每条黑杠都是一个环回
r4:
[r4]int s 4/0/0
[r4-Serial4/0/0]ip add 34.0.0.2 24
[r4-Serial4/0/0]
Oct 8 2021 21:08:29-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 s 4/0/1
[r4-Serial4/0/1]ip add 45.0.0.2 24
[r4-Serial4/0/1]
Oct 8 2021 21:08:59-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPP
IPCP on the interface Serial4/0/1 has entered the UP state.
[r4-Serial4/0/1]int s 3/0/0
[r4-Serial3/0/0]ip add 46.0.0.2 24
[r4-Serial3/0/0]
Oct 8 2021 21:09:16-08:00 r4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPP
IPCP on the interface Serial3/0/0 has entered the UP state.
[r4-Serial3/0/0]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 47.0.0.2 24
Oct 8 2021 21:09:31-08:00 r4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r4-GigabitEthernet0/0/0]int l0
[r4-LoopBack0]ip add 4.4.4.4 24
[r4]sys isp
r3:
[r3-Serial4/0/0]ip add 34.0.0.1 24
[r3]ip route-static 0.0.0.0 0 34.0.0.2
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip add 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
r5:
[r5]int s 4/0/0
[r5-Serial4/0/0]ip add 45.0.0.1 24
[r5-LoopBack0]ip add 172.16.2.1 24
[r5]ip route-static 0.0.0.0 0 45.0.0.2
[r5]int t 0/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]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
r6:
[r6]int s 4/0/0
[r6-Serial4/0/0]ip add 46.0.0.1 24
[r6-LoopBack0]ip add 172.16.3.1 24
[r6]ip route-static 0.0.0.0 0 46.0.0.2
[r6]int t 0/0/0
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source Serial 4/0/0
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
r7:
[r7]int g 0/0/0
[r7-GigabitEthernet0/0/0]ip add 47.0.0.1 24
[r7-LoopBack0]ip add 172.16.4.1 24
[r7]ip route-static 0.0.0.0 0 47.0.0.2
[r7]int t 0/0/0
[r7-Tunnel0/0/0]ip add 172.16.1.4 29
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp
[r7-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r7-Tunnel0/0/0]nhrp network-id 100
[r7-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
MGRE环境查看r3:
[r3]display nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
172.16.1.2 32 45.0.0.1 172.16.1.2 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:05:28
Expire time : 01:54:32
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
172.16.1.3 32 46.0.0.1 172.16.1.3 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:03:14
Expire time : 01:56:46
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
172.16.1.4 32 47.0.0.1 172.16.1.4 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:00:57
Expire time : 01:59:03
Number of nhrp peers: 3
测试:
[r3]ping 172.16.1.2
PING 172.16.1.2: 56 data bytes, press CTRL_C to break
Reply from 172.16.1.2: bytes=56 Sequence=1 ttl=255 time=80 ms
Reply from 172.16.1.2: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 172.16.1.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 172.16.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 172.16.1.2: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 172.16.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/42/80 ms
[r3]ping 172.16.1.4
PING 172.16.1.4: 56 data bytes, press CTRL_C to break
Reply from 172.16.1.4: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 172.16.1.4: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 172.16.1.4: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 172.16.1.4: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 172.16.1.4: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 172.16.1.4 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/40/50 ms
[r3]ping 172.16.1.3
PING 172.16.1.3: 56 data bytes, press CTRL_C to break
Reply from 172.16.1.3: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 172.16.1.3: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 172.16.1.3: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 172.16.1.3: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 172.16.1.3: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 172.16.1.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/42/60 ms
2:配置area 1
r1:
[Huawei]sys r1
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0] ip add 172.16.33.1 29
[r1-GigabitEthernet0/0/0]int l0
[r1-LoopBack0]ip add 172.16.34.1 24
r2:
[Huawei]sys r2
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 172.16.33.2 29
[r2-GigabitEthernet0/0/0]int l0
[r2-LoopBack0]ip add 172.16.35.1 24
r3:
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 172.16.33.3 29
[r3-GigabitEthernet0/0/0]int l0
[r3-LoopBack0]ip add 172.16.36.1 24
r6:
[r6]int g 0/0/0
[r6-GigabitEthernet0/0/0]ip add 172.16.65.1 29
r11:
[Huawei]sys r11
[r11]int g 0/0/0
[r11-GigabitEthernet0/0/0]ip add 172.16.65.2 29
[r11-GigabitEthernet0/0/0]int g 0/0/1
[r11-GigabitEthernet0/0/1]ip add 172.16.65.9 29
[r11-GigabitEthernet0/0/1]int l0
[r11-LoopBack0]ip add 172.16.66.1 24
r12:
[Huawei]sys r12
[r12]int g 0/0/0
[r12-GigabitEthernet0/0/0]ip add 192.16.65.10 29
r7:
[r7]int g 0/0/1
[r7-GigabitEthernet0/0/1]ip add 172.16.97.1 29
r8:
[Huawei]sys r8
[r8]int g 0/0/0
[r8-GigabitEthernet0/0/0]ip add 172.16.97.2 29
[r8-GigabitEthernet0/0/0]int g 0/0/1
[r8-GigabitEthernet0/0/1]ip add 172.16.97.9 29
[r8-GigabitEthernet0/0/1]int l0
[r8-LoopBack0]ip add 172.16.98.1 24
r9:
[r9]int g 0/0/0
[r9-GigabitEthernet0/0/0]ip add 172.16.97.10 29
r9:
[r9-GigabitEthernet0/0/1]ip add 172.16.129.1 29
[r9-LoopBack0]ip add 172.16.130.1 24
r10:
[r10-GigabitEthernet0/0/0]ip add 172.16.129.2 29
[r10-LoopBack0]ip add 172.16.131.1 24
[r12-LoopBack0]ip add 172.16.160.1 20
[r12-LoopBack1]ip add 172.16.176.1 20
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]a 1
[r2-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]a 1
[r3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.255
[r3-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
[r6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.3.255
[r6-ospf-1]a 2
[r6-ospf-1-area-0.0.0.2]network 172.16.65.1 0.0.0.0
[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.0 0.0.255.255
[r12]ospf 1 router-id 12.12.12.12
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.2]network 172.16.65.10 0.0.0.0
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]network 172.16.97.1 0.0.0.0
[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.0 0.0.255.255
[r9]ospf 1 router-id 9.9.9.9
[r9-ospf-1]area 3
[r9-ospf-1-area-0.0.0.3]network 172.16.97.10 0.0.0.0
[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.128.0 0.0.3.255
[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.0.0 0.0.255.255
[r12]rip 1
[r12-rip-1]version 2
[r12-rip-1]network 172.16.0.0
p2p类型无法与其他路由建立邻居关系,改成p2mp类型
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ospf network-type p2mp
[r5]int Tunnel 0/0/0
[r5-Tunnel0/0/0]ospf network-type p2mp
[r6]int Tunnel 0/0/0
[r6-Tunnel0/0/0]ospf network-type p2mp
[r7]int Tunnel 0/0/0
[r7-Tunnel0/0/0]ospf network-type p2mp
因为此拓补图不是规则的星型拓补,area 4 和 rip区域的路由信息会缺失需要手动导入它们的路由信息
[r9]ospf 1
[r9-ospf-1]import-route ospf 2
[r12]ospf 1
[r12-ospf-1]import-route rip 1
所以r10收不到其它路由信息,需要我们在r9上下发一条缺省给r10
[r9]ospf 2
[r9-ospf-2]default-route-advertise
空接口路由也要做,因为汇总了
汇总:
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
[r3]ip route-static 172.16.32.0 19 NULL 0
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[r6]ip route-static 172.16.64.0 19 NULL 0
[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
[r7]ip route-static 172.16.96.0 19 NULL 0
[r9]ospf 1
[r9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
[r9]ip route-static 172.16.128.0 19 NULL 0
[r12]ospf 1
[r12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
[r12]ip route-static 172.16.160.0 19 NULL 0
特殊区域:
[r1]ospf 1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]stub
[r2]ospf 1
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]stub
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]stub no-summary
[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]nssa no-summary
[r8]ospf 1
[r8-ospf-1]area 3
[r8-ospf-1-area-0.0.0.3]nssa
[r9]ospf 1
[r9-ospf-1]area 3
[r9-ospf-1-area-0.0.0.3]nssa
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]nssa no-summary
[r11]ospf 1
[r11-ospf-1]area 2
[r11-ospf-1-area-0.0.0.2]nssa
[r12]ospf 1
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.2]nssa
[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
[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 g 0/0/0
[r7-GigabitEthernet0/0/0]nat outbound 2000
[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 s 4/0/0
[r6-Serial4/0/0]nat outbound 2000
[r5]int t 0/0/0
[r5-Tunnel0/0/0]ospf timer hello 5
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ospf timer hello 5
[r6]int t 0/0/0
[r6-Tunnel0/0/0]ospf timer hello 5
[r7]int t 0/0/0
[r7-Tunnel0/0/0]ospf timer hello 5
说明:时间得修改,死亡时间也会自动更改
[r2]ospf 1
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 000000
[r1]ospf 1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]authentication-mode md5 1 000000
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 000000