网络基础(十四)实操----综合性实验

问题描述:

说明:每条黑杠都是一个环回

一:IP地址划分及配置

1:配置area 0 并搭建MGRE环境

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

3:配置area 2

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

4:配置area 3

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

5:配置area 4

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

6:配置rip

[r12-LoopBack0]ip add 172.16.160.1 20
[r12-LoopBack1]ip add 172.16.176.1 20

 二:配置OSPF、RIP协议

1.area 1------r1、r2整个汇总宣告,r3取相同去不同汇总宣告

[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

2.area 0-----激活tunnel接口就行,r6分开宣告

[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

3.area 2

[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

 4.area 3

[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

5.area 4

[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

6.rip  ----汇总宣告

[r12]rip 1
[r12-rip-1]version 2
[r12-rip-1]network 172.16.0.0 

 三.修改MGRE的类型

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

 五.减少LSA更新量------做汇总与特殊区域

空接口路由也要做,因为汇总了

汇总:

[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 

 六.配置NAT-------访问r4的环回

[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

 七.加快收敛,修改hello时间------都得修改

[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

说明:时间得修改,死亡时间也会自动更改

八.做手工认证(area区域认证)---------更新安全

[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

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值