实验配置:
1、各区域IP地址的划分
将172.16.0.0/16的网段进行子网划分,将该网段划分为8个网段,取其中6个作为我们实验所使用的IP地址,剩下的2个IP地址作为我们的备份网段,方便以后该网络拓扑结构发生变化,需要增加设备,来所留的备用网段。每个网段在进行子网划分,分为P2P网络需要所使用的IP地址,和MA网络所使用的IP地址,及环回地址所使用的IP地址。各个区域IP地址的划分结果如下:
注意:
1、如今的实验需要判断网络接口类型为P2P网络类型还是MA网络类型。
2、如今做的实验要切合实际工程,因为一个广播域一般最多也就有200到300台主机设备,所以划分网段需将网段划分为/24的网段来使用,这样更加切合实际。
3、P2P网络类型当中只有两台设备,因此可以使用/30的网段,而在实际当中MA网络类型当中有可能存在多台路由器使用一个网段,因此将MA网络当中网段划分为/29的网段更加合理。
172.16.0.0/16
172.16.0.0/19---a0
172.16.0.0/24 ---p2p骨干
172.16.0.0/30
172.16.0.4/30
172.16.0.8/30
....
172.16.1.0/24 ---MA骨干
172.16.1.0/29
172.16.1.8/29
172.16.1.16/29
...
用户 172.16.2.0/24
172.16.3.0/24
....
172.16.31.0/24
172.16.32.0/19---a1
172.16.32.0/24 ---p2p骨干
172.16.32.0/30
...
172.16.33.0/24 ---MA骨干
172.16.33.0/29
...
...
172.16.64.0/19---a2
172.16.64.0/24 --- P2P骨干
172.16.65.0/24 --- MA骨干
172.16.66.0/24....
172.16.96.0/19---a3
172.16.128.0/19---a4
172.16.160.0/19---RIP
172.16.160.0/20
172.16.176.0/20
172.16.192.0/19
172.16.224.0/19
2.搭建MGRE环境:
配置R3为中心站点
[r3]int t0/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.01
Jul 19 2022 21:06:51-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 network-id 100
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
分支:(顺便补上环回)
[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
Jul 19 2022 21:10:28-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 network-id 100
[r5-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
[r6]int t0/0/0
[r6-Tunnel0/0/0]ip add 172.16.1.3 29
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source Serial 4/0/0
Jul 19 2022 21:14:10-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 network-id 100
[r6-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
区域1
[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]area 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]
[r3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.255
区域0
[r3]ospf
[r3-ospf-1]a 0
[r3-ospf-1-area-0.0.0.0]n
[r3-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]a 0
[r5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
[r6]ospf 1 r
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]a 0
[r6-ospf-1-area-0.0.0.0]n
[r6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.3.255
[r6-ospf-1-area-0.0.0.0]
Jul 19 2022 22:16:57-08:00 r6 %%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)
[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.........