1.拓扑图
二.实验步骤
1.合理配置IP地址,基于172.16.0.0/16 划分
从图中可看出,图中有RIP 以及OSPF,因此在划分网段时,需将两者均考虑进去
共有五个区域以及RIP网段,因此需要划分6个网段以供使用
因此在基于172.16.00000000.00000000网段在主机位借3位进行划分,注意借三位,因此网络掩码变为19
(1)
172.16.000 00000.00000000 172.16.0.0 19 ---area0
因为环回宣告也需要继续进行划分,例如area0中,R1 R2 R3的环回宣告在此区域,因此需要继续借位划分,环回模拟用户网段,用户网段一般不会超过200-300限制,用户网段一般给与24位网络掩码,所以,可以借5位,最终可以有2^5=32个网段。
a.172.16.000 00000. 00000000 172.16.0.0 24 ----P2P(一般借位到30)
172.16.00000000.000000 00 172.16.0.0 30
172.16.00000000.000001 00 172.16.0.4 30
172.16.00000000.000010 00 172.16.0.8 30
b.172.16.000 00001. 00000000 172.16.1.0 24-------MA 区域中通过交换机连接,相当于构建MA网络,由于掩码借位30不够用,一般情况借位到29
172.16.00000001.00000 000 172.16.1.0 29
172.16.00000001.00001 000 172.16.1.8 29 172.16.1.16 29
172.16.2.0 24
172.16.3.0 24
172.16.4.0 24 ......172.16.31.0 24
(2)172.16.001 00000.00000000 172.16.32.0 19---area1
(3)172.16.010 00000.00000000 172.16.64.0 19---area2
(4)172.16.011 00000.00000000 172.16.96.0 19---area3
(5)172.16.100 00000.00000000 172.16.128.0 19---area4
(6)172.16.101 00000.00000000 172.16.160.0 19---rip
(7) 图中仅需六个网段,因此剩余两个网段将用来后续的拓展
172.16.110 00000.00000000 172.16.192.0 19
172.16.111 00000.00000000 172.16.224.0 19
补充:网络类型:P2P MA
补充:网络类型:P2P MA
配置:
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 172.16.33.1 29
Oct 15 2022 20:13:19-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 l0
[r1-LoopBack0]ip address 172.16.34.1 24
[r1-LoopBack0]
ospf激活
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]net
[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]
配置STUB
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]stub
[r1]dis
[r1]display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 2.2.2.2 2.2.2.2 34 48 8000000A 1
Router 1.1.1.1 1.1.1.1 26 48 8000000B 1
Router 3.3.3.3 3.3.3.3 27 48 80000007 1
Network 172.16.33.1 1.1.1.1 26 36 80000008 0
Sum-Net 0.0.0.0 3.3.3.3 99 28 80000001 1
AR2:
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip address 172.16.33.2 29
Oct 15 2022 20:14:34-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 address 172.16.35.1 24
[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
[r2]ospf
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]stub
做完NAT后,可以实现对公网环回的访问结果
<r2>ping 4.4.4.4
PING 4.4.4.4: 56 data bytes, press CTRL_C to break
Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=254 time=100 ms
Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=254 time=60 ms
Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=254 time=70 ms
Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=254 time=50 ms
--- 4.4.4.4 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/62/100 ms
AR3:
[r3]interface s4/0/0
[r3-Serial4/0/0]ip address 34.0.0.1 24
[r3-Serial4/0/0]
Oct 15 2022 19:40:29-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
[r3]ip route-static 0.0.0.0 0 34.0.0.2
[r3]ping 46.0.0.2
PING 46.0.0.2: 56 data bytes, press CTRL_C to break
Reply from 46.0.0.2: bytes=56 Sequence=1 ttl=255 time=170 ms
Reply from 46.0.0.2: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 46.0.0.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 46.0.0.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 46.0.0.2: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 46.0.0.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/52/170 ms
配置中心的MGRE 环境
[r3]interface t
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 172.16.1.1 29
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
此处的source必须指定地址,如果是MESH环境,既是中心,又是分支,可以不指定
[r3-Tunnel0/0/0]source 34.0.0.1
Oct 15 2022 19:54:38-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
注意此处可以通过创建nhrp池来确定目标
[r3-Tunnel0/0/0]nhrp network-id 100
伪广播开启
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip address 172.16.33.3 29
Oct 15 2022 20:16:31-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 l0
[r3-LoopBack0]ip address 172.16.36.1 24
OSPF宣告
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]display ip interface brief
*down: administratively down
[r3-ospf-1]display ip interface