HCIA作业四

一、实验目的

二、实验要求

1、R4为ISP,其上只配置IP地址;R4与其他所直连设备间均使用公有IP;
2、R3-R5、R6、R7为MGRE环境,R3为中心站点;
3、整个OSPF环境IP基于172.16.0.0/16划分;除了R12有两个环回,其他路由器均有一个环回IP
4、所有设备均可访问R4的环回;
5、减少LSA的更新量,加快收敛,保障更新安全;
6、全网可达;

三、实验步骤

1、配置ip
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 172.16.33.1 24
Apr 19 2024 22:37:05-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


<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 172.16.33.2 24
Apr 19 2024 22:12:11-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]int l0
[R2-LoopBack0]ip add 172.16.35.2 24


<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 172.16.33.3 24
Apr 19 2024 22:13:32-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R3-GigabitEthernet0/0/0]int s4/0/0
[R3-Serial4/0/0]ip add 34.0.0.3 24
[R3-Serial4/0/0]int l0
[R3-LoopBack0]ip add 172.16.36.3 24


<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R4
[R4]int s4/0/0
[R4-Serial4/0/0]ip add 34.0.0.4 24
[R4-Serial4/0/0]
Apr 19 2024 22:15:52-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 s4/0/1
[R4-Serial4/0/1]ip add 45.0.0.4 24
[R4-Serial4/0/1]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 47.0.0.4 24
Apr 19 2024 22:17:02-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]: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 172.16.2.4 24


<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R5
[R5]int s4/0/0
[R5-Serial4/0/0]ip add 45.0.0.5 24
[R5-Serial4/0/0]
Apr 19 2024 22:18:15-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
 IPCP on the interface Serial4/0/0 has entered the UP state. 
[R5-Serial4/0/0]int l0
[R5-LoopBack0]ip add 172.16.3.5 24



<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R6
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 172.16.65.1 30
Apr 19 2024 22:19:27-08:00 R6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R6-GigabitEthernet0/0/0]int s4/0/0
[R6-Serial4/0/0]ip add 46.0.0.6 24
[R6-Serial4/0/0]q
[R6]int l0
[R6-LoopBack0]ip add 172.16.4.6 24



<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R7
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ip add 47.0.0.7 24
Apr 19 2024 22:21:18-08:00 R7 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R7-GigabitEthernet0/0/0]int g0/0/1
[R7-GigabitEthernet0/0/1]ip add 172.16.97.1 30
Apr 19 2024 22:21:47-08:00 R7 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R7-GigabitEthernet0/0/1]int l0
[R7-LoopBack0]ip add 172.16.5.7 24



<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R8
[R8]int g0/0/0
[R8-GigabitEthernet0/0/0]ip add 172.16.97.2 30
Apr 19 2024 22:23:12-08:00 R8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R8-GigabitEthernet0/0/0]int g0/0/1
[R8-GigabitEthernet0/0/1]ip add 172.16.97.5 30
Apr 19 2024 22:23:35-08:00 R8 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R8-GigabitEthernet0/0/1]int l0
[R8-LoopBack0]ip add 172.16.98.8 24



<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R9
[R9]int g0/0/0
[R9-GigabitEthernet0/0/0]ip add 172.16.97.6 30
[R9-GigabitEthernet0/0/0]
Apr 19 2024 22:25:01-08:00 R9 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R9-GigabitEthernet0/0/0]int g0/0/1
[R9-GigabitEthernet0/0/1]ip add 172.16.129.1 30
Apr 19 2024 22:25:34-08:00 R9 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R9-GigabitEthernet0/0/1]int l0
[R9-LoopBack0]ip add 172.16.130.9 24


<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R10
[R10]int g0/0/0
[R10-GigabitEthernet0/0/0]ip add 172.16.129.2 30
[R10-GigabitEthernet0/0/0]
Apr 19 2024 22:27:48-08:00 R10 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R10-GigabitEthernet0/0/0]int l0
[R10-LoopBack0]ip add 172.16.131.10 24



<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R11
[R11]int g0/0/0
[R11-GigabitEthernet0/0/0]ip add 172.16.65.2 30
Apr 19 2024 22:30:44-08:00 R11 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R11-GigabitEthernet0/0/0]int g0/0/1
[R11-GigabitEthernet0/0/1]ip add 172.16.65.5 30
Apr 19 2024 22:31:07-08:00 R11 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R11-GigabitEthernet0/0/1]int l0
[R11-LoopBack0]ip add 172.16.66.11 24




<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sy R12
[R12]int g0/0/0
[R12-GigabitEthernet0/0/0]ip add 172.16.65.6 30
Apr 19 2024 22:35:00-08:00 R12 %%01IFNET/4/LINK_STATE(l)[1]: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.12 24
[R12-LoopBack0]int l1
[R12-LoopBack1]ip add 172.16.161.12 24
2、配内网通和公网通
①分区域配置私网通

area 0:

<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]ne 172.16.3.0 0.0.0.255


<R6>sys
Enter system view, return user view with Ctrl+Z.
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]ne 172.16.4.0 0.0.0.255


<R7>sys
Enter system view, return user view with Ctrl+Z.
[R7]ospf 1 rouetr-id 7.7.7.7
           ^
Error:Too many parameters found at '^' position.
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]a 0 
[R7-ospf-1-area-0.0.0.0]ne 172.16.5.0 0.0.0.255

area 1:

[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]ne 172.16.33.1 0.0.0.0
[R1-ospf-1-area-0.0.0.1]ne 172.16.34.0 0.0.0.255


<R2>sys
Enter system view, return user view with Ctrl+Z.
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]ne 172.16.33.2 0.0.0.0
[R2-ospf-1-area-0.0.0.1]ne 172.16.35.0 0.0.0.255



<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]ne 172.16.33.3 0.0.0.0
[R3-ospf-1-area-0.0.0.1]ne 172.16.35.0 0.0.0.255

area 2:

[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]ne 172.16.65.1 0.0.0.0
 
[R11]ospf 1 router-id 11.11.11.11
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]ne 172.16.65.2 0.0.0.0
[R11-ospf-1-area-0.0.0.2]ne 172.16.65.5 0.0.0.0
[R11-ospf-1-area-0.0.0.2]ne 172.16.66.0 0.0.0.255
 
[R12]ospf 1 router-id 12.12.12.12
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]ne 172.16.65.6 0.0.0.0
配置R12上的RIP
[R12]rip 1
[R12-rip-1]v 2
[R12-rip-1]undo summary 
[R12-rip-1]ne 172.16.0.0
进入ospf进程下引入rip
[R12]ospf 1
[R12-ospf-1]import-route rip

area 3:

[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]ne 172.16.97.1 0.0.0.0
 
[R8]ospf 1 router-id 8.8.8.8
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]ne 172.16.97.2 0.0.0.0
[R8-ospf-1-area-0.0.0.3]ne 172.16.97.5 0.0.0.0
[R8-ospf-1-area-0.0.0.3]ne 172.16.98.0 0.0.0.255
 
[R9]ospf 1 router-id 9.9.9.9
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]ne 172.16.97.6 0.0.0.0

area 4:(对于不规则区域,使用多进程双向重发布)

[R9]ospf 2
[R9-ospf-2]a 4
[R9-ospf-2-area-0.0.0.4]ne 172.16.129.1 0.0.0.0
[R9-ospf-2-area-0.0.0.4]ne 172.16.130.0 0.0.0.255
 
[R10]ospf 2 router-id 10.10.10.10
[R10-ospf-2]a 4
[R10-ospf-2-area-0.0.0.4]ne 172.16.129.2 0.0.0.0
[R10-ospf-2-area-0.0.0.4]ne 172.16.131.0 0.0.0.255
 
进入R9在ospf1、2进程下引入另一个进程
[R9]ospf 1
[R9-ospf-1]import-route ospf 2
[R9-ospf-1]q
[R9]ospf 2
[R9-ospf-2]import-route ospf 1
②配置公网通,搭建MGRE环境

公网缺省配置

[R3]ip route-static 0.0.0.0 0 34.0.0.4
[R5]ip route-static 0.0.0.0 0 45.0.0.4
[R6]ip route-static 0.0.0.0 0 46.0.0.4
[R7]ip route-static 0.0.0.0 0 47.0.0.4

搭建MGRE环境———中心站点

[R3]int t 0/0/0
[R3-Tunnel0/0/0]ip add 172.16.6.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R3-Tunnel0/0/0]source Serial 4/0/0
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry multicast dynamic 

分站点

[R5]int t 0/0/0
[R5-Tunnel0/0/0]ip add 172.16.6.5 24
[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.6.3 34.0.0.3 register 
 
[R6]int t 0/0/0
[R6-Tunnel0/0/0]ip add 172.16.6.6 24
[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.6.3 34.0.0.3 register
 
[R7]int t0/0/0
[R7-Tunnel0/0/0]ip add 172.16.6.7 24
[R7-Tunnel0/0/0]tunnel-protocol gre p2mp
[R7-Tunnel0/0/0]source g0/0/0
[R7-Tunnel0/0/0]nhrp network-id 100
[R7-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register

在ospf宣告隧道

[R3-ospf-1-area-0.0.0.0]ne 172.16.6.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]ne 172.16.6.0 0.0.0.255
[R6-ospf-1-area-0.0.0.0]ne 172.16.6.0 0.0.0.255
[R7-ospf-1-area-0.0.0.0]ne 172.16.6.0 0.0.0.255

修改隧道类型

[R3]int t0/0/0
[R3-Tunnel0/0/0]ospf network-type broadcast 
 
[R5]int t0/0/0
[R5-Tunnel0/0/0]ospf network-type broadcast
 
[R6]int t0/0/0
[R6-Tunnel0/0/0]ospf network-type broadcast
 
[R7]int t0/0/0
[R7-Tunnel0/0/0]ospf network-type broadcast

分支站点放弃选举

[R5-Tunnel0/0/0]ospf dr-priority 0
[R6-Tunnel0/0/0]ospf dr-priority 0
[R7-Tunnel0/0/0]ospf dr-priority 0

检查路由表(R3):

ping通测试(R1pingR10的环回和RIP网段):

3、配置nat easy ip能够访问R4的环回
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R3]int s 4/0/0
[R3-Serial4/0/0]nat outbound 2000
 
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R5]int s 4/0/0
[R5-Serial4/0/0]nat outbound 2000
 
[R6]acl 2000
[R6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R6]int s 4/0/0
[R6-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]int g0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000
4、区域汇总
①ABR汇总:
area 1
[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
 
area 2
[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
 
area 3
[R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
 
②ASBR汇总:
[R12]ospf 1
[R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
 
[R9]ospf 1
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
③汇总后的路由表:

④lsdb表:

5.配置特殊区域
area 1 ----- totally stub
[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]stub no-summary 
 
[R1]ospf 1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]stub no-summary 
 
[R2]ospf 1
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]stub no-summary 
设置后的路由表和lsdb表: 

area 2 ----- totally nssa
[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]nssa no-summary 
 
[R11]ospf 1
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]nssa no-summary 
 
[R12]ospf 1
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]nssa no-summary 

area 3 ----- totally nssa
[R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]nssa no-summary 
 
[R8]ospf 1
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]nssa no-summary 
 
[R9]ospf 1
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]nssa no-summary 

其他路由通过缺省路由访问,R10无法学习到其他的路由

在R9给R10下发默认缺省让R10能够访问其他网段:
[R9]ospf 2
[R9-ospf-2]default-route-advertise 

这里因为下发缺省后,easy ip的问题也能够解决了,ping通测试:
6.更改hello时间加快收敛

area 0:

[R3]int t0/0/0
[R3-Tunnel0/0/0]ospf timer hello 5
 
[R5]int t0/0/0
[R5-Tunnel0/0/0]ospf timer hello 5
 
[R6]int t0/0/0
[R6-Tunnel0/0/0]ospf timer hello 5
 
[R7]int t0/0/0
[R7-Tunnel0/0/0]ospf timer hello 5

area 1:

[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf timer hello 5
 
[R2]int g0/0/0
[R3-GigabitEthernet0/0/0]ospf timer hello 5
 
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ospf timer hello 5

area 2:

[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ospf timer hello 5
 
[R11]int g0/0/0
[R11-GigabitEthernet0/0/0]ospf timer hello 5
[R11]int g0/0/1
[R11-GigabitEthernet0/0/1]ospf timer hello 5
 
[R12]int g0/0/0
[R12-GigabitEthernet0/0/0]ospf timer hello 5

area 3:

[R7]int g0/0/1
[R7-GigabitEthernet0/0/1]ospf timer hello 5
 
[R8]int g0/0/0
[R8-GigabitEthernet0/0/0]ospf timer hello 5
[R8]int g0/0/1
[R8-GigabitEthernet0/0/1]ospf timer hello 5
 
[R9]int g0/0/0
[R9-GigabitEthernet0/0/0]ospf timer hello 5

area 4:

[R9]int g0/0/1
[R9-GigabitEthernet0/0/1]ospf timer hello 5
 
[R10]int g0/0/0
[R10-GigabitEthernet0/0/0]ospf timer hello 5

7.配置认证保证安全

area 0:

[R3]ospf 1
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123
 
[R5]ospf 1
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123
 
[R7]ospf 1
[R7-ospf-1]a 0
[R7-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123
 
[R6]ospf 1
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123

area 1:

[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123
 
[R1]ospf 1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123
 
[R2]ospf 1
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123

area 2:

[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123
 
[R11]ospf 1
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123
 
[R12]ospf 1
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123

area 3:

[R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123
 
[R8]ospf 1
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123
 
[R9]ospf 1
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123

area 4:

[R9]ospf 2
[R9-ospf-2]a 4
[R9-ospf-2-area-0.0.0.4]authentication-mode md5 1 cipher 123
 
[R10]ospf 2
[R10-ospf-2]a 4
[R10-ospf-2-area-0.0.0.4]authentication-mode md5 1 cipher 123
  • 5
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值