ospf综合实验

一、拓扑图

二、实验要求

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

三、实验步骤

(1)划分网段

(2)配置ip,环回,缺省路由
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip a 172.16.33.1 29
Apr 24 2024 21:00:49-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 l 0
[r1-LoopBack0]ip a 172.16.34.1 24


[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip a 172.16.33.2 29
[r2-GigabitEthernet0/0/0]int lo0
[r2-LoopBack0]ip a 172.16.35.1 24


[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip a 172.16.33.3 29
[r3-GigabitEthernet0/0/0]int lo0
[r3-LoopBack0]ip a 172.16.36.1 24
[r3]int s 4/0/0
[r3-Serial4/0/0]ip a 34.0.0.1 24
[r3]ip route-static 0.0.0.0 0 34.0.0.2


[r4]int s 4/0/0
[r4-Serial4/0/0]ip a 34.0.0.2 24
[r4-Serial4/0/0]
Apr 24 2024 20:38:19-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 3/0/0
[r4-Serial3/0/0]ip a 46.0.0.2 24
[r4-Serial3/0/0]int s 4/0/1
[r4-Serial4/0/1]ip a 45.0.0.2 24
[r4-Serial4/0/1]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip a 47.0.0.2 24
Apr 24 2024 20:40:08-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 l 0
[r4-LoopBack0]ip a 4.4.4.4 24


[r5]int s 4/0/0
[r5-Serial4/0/0]ip a 45.0.0.1 24
[r5-Serial4/0/0]
Apr 24 2024 20:41:28-08:00 Huawei %%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 l 0
[r5-LoopBack0]ip a 172.16.2.1 24
[r5-LoopBack0]q
[r5]sys r5
[r5]ip rou	
[r5]ip route
[r5]ip route-static 0.0.0.0 0 45.0.0.2

[r6]int s 4/0/0
[r6-Serial4/0/0]ip a 46.0.0.1 24
[r6-Serial4/0/0]
Apr 24 2024 20:45:13-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
 IPCP on the interface Serial4/0/0 has entered the UP state. 
[r6-Serial4/0/0]int l 0
[r6-LoopBack0]ip a 172.16.3.1 24
[r6-LoopBack0]q
[r6]ip rou	
[r6]ip route
[r6]ip route-static 0.0.0.0 0 46.0.0.2


[r7]int g0/0/0
[r7-GigabitEthernet0/0/0]ip a 47.0.0.1 24
[r7-GigabitEthernet0/0/0]int lo0
[r7-LoopBack0]ip a 172.16.4.1 24
[r7]ip route-static 0.0.0.0 0 47.0.0.2
[r7]int t0/0/0


[r8]int g 0/0/0
[r8-GigabitEthernet0/0/0]ip a 172.16.97.2 29
[r8-GigabitEthernet0/0/0]
Apr 24 2024 21:11:52-08:00 Huawei %%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 l 0
[r8-LoopBack0]int g 0/0/1
[r8-GigabitEthernet0/0/1]ip a 172.16.97.9 29
Apr 24 2024 21:12:34-08:00 Huawei %%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]q
[r8]int g0/0/0
[r8-GigabitEthernet0/0/0]ip a 172.16.97.2 29
[r8-GigabitEthernet0/0/0]int lo0
[r8-LoopBack0]ip a 172.16.98.1 24
[r8-LoopBack0]int g 0/0/1
[r8-GigabitEthernet0/0/1]ip a 172.16.97.9 29


[r9]int g 0/0/0
[r9-GigabitEthernet0/0/0]ip a 172.16.97.10 29
Apr 24 2024 21:14: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 g 0/0/1
[r9-GigabitEthernet0/0/1]ip a 172.16.129.1 29
Apr 24 2024 21:14:48-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 l 0
[r9-LoopBack0]ip a 172.16.130.1 24


[r10]int g 0/0/0
[r10-GigabitEthernet0/0/0]ip a 172.16.65.2 29
Apr 24 2024 21:16:44-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 l 0
[r10-LoopBack0]ip a 172.16.131.1 24
[r10-LoopBack0]q
[r10]int g 0/0/0
[r10-GigabitEthernet0/0/0]undo ip a 172.16.65.2 29
Apr 24 2024 21:18:45-08:00 r10 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the DOWN state. 
[r10-GigabitEthernet0/0/0]
[r10-GigabitEthernet0/0/0]ip a 172.16.129.2 29
[r10-GigabitEthernet0/0/0]
Apr 24 2024 21:19:47-08:00 r10 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 


[r11]int g 0/0/0
[r11-GigabitEthernet0/0/0]ip a 172.16.65.2 29
Apr 24 2024 21:21:06-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 l 0
[r11-LoopBack0]ip a 172.16.66.1 24
[r11-LoopBack0]int g 0/0/1
[r11-GigabitEthernet0/0/1]ip a 172.16.65.9 29
Apr 24 2024 21:22:37-08:00 r11 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 

[r12]int g 0/0/0
[r12-GigabitEthernet0/0/0]ip a 172.16.65.10 29
[r12-GigabitEthernet0/0/0]
Apr 24 2024 21:23:25-08:00 r12 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r12-GigabitEthernet0/0/0]int l 0
[r12-LoopBack0]ip a 172.16.160.1 20
[r12-LoopBack0]int l 1
[r12-LoopBack1]ip a 172.16.176.1 20
(3)R3-R5/6/7为MGRE环境,R3为中心站点;
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip a 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]int t 0/0/0
[r5-Tunnel0/0/0]ip a 172.16.1.3 29
[r5-Tunnel0/0/0]tu	
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source s 4/0/0
Apr 24 2024 20:53:22-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]
[r5-Tunnel0/0/0]nhrp n	
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 r	
[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 a 172.16.1.2 29
[r6-Tunnel0/0/0]tu	
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]sou	
[r6-Tunnel0/0/0]source s 4/0/0
Apr 24 2024 20:55:36-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]
[r6-Tunnel0/0/0]nhrp n	
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 r	
[r6-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register 

[r7]int t0/0/0
[r7-Tunnel0/0/0]ip a 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 
(4)启动ospf
[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-r12与r1相似略
(5)r12重发布

[r12]ospf 1
[r12-ospf-1]import	
[r12-ospf-1]import-route rip 1
(6)防环

[r3]ip route-static 172.16.32.0 19 NULL 0
r6,r7,r9,r12类似略
(7)减少LSA的更新量
[r1]ospf 1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]stub 


[r2]ospf 1
[r2-ospf-1]a 1
[r2-ospf-1-area-0.0.0.1]stub 

[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
[r3-ospf-1-area-0.0.0.1]stub no-summary 

 
[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
[r3-ospf-1-area-0.0.0.1]stub no-summary 

 
[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

r11]ospf 1
[r11-ospf-1]a 2  
[r11-ospf-1-area-0.0.0.2]nssa 

[r8]ospf 1
[r8-ospf-1]a 3
[r8-ospf-1-area-0.0.0.3]nssa 

 
[r9]ospf 1
[r9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0

[r12]ospf 1
[r12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0

(8)区域认证
[r1]ospf 1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
r2,r3......
(9)NAT协议
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,r6,r7.....
(10)加快收敛
[r3]int t0/0/0
[r3-Tunnel0/0/0]ospf timer hello 10

r5,r6,r7.......

四、测试

(1)R3-R5/6/7为MGRE环境,R3为中心站点;

(2)ospf

(3)全网可达

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值