实验要求:
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.地址规划 172.16.0.0/16–借出三个为网络位划分出8个子网
172.16.0.0/19 A0 172.16.0.0/25 172.16.0.128/25 172.16.1.0/25 172.16.1.128/25…172.16.31.128/25 172.16.0.0/25 分给点到点骨干(p2p骨干) 172.16.0.0/30 172.16.0.4/30 172.16.0.128/25 分给多点(MA骨干) 172.16.0.128/29 172.13.0.136/29…
172.16.32.0/19 A1 172.16.32.0/25 172.16.32.128/25 172.16.33.0/25 172.16.33.128/25…172.16.63.128/25 172.16.32.0/25 分给点到点骨干(p2p骨干) 172.16.32.0/30 172.16.32.4/30 172.16.32.128/25 分给多点(MA骨干) 172.16.32.128 172.16.32.136/30
172.16.64.0/19 A2 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
1.先将公网弄通,搭建gre,配gre的ip R4中回环地址为4.4.4.4 24 [R4]interface loopback 0 [R4-loopback0]ip address 4.4.4.4 24 接口地址 [R4-loopback0]interface GigabitEthernet0/0/0 [R4- GigabitEthernet0/0/0]ip address 34.1.1.2 24 [R4- GigabitEthernet0/0/0]interface GigabitEthernet0/0/1 [R4- GigabitEthernet0/0/1]ip address 45.1.1.2 24 [R4- GigabitEthernet0/0/1]interface GigabitEthernet0/0/2 [R4- GigabitEthernet0/0/2]ip address 46.1.1.2 24 [R4- GigabitEthernet0/0/2]interface GigabitEthernet4/0/0 [R4- GigabitEthernet4/0/0]ip address 47.1.1.2 24
[R3]interface GigabitEthernet0/0/2 [R3- GigabitEthernet0/0/2]ip address 34.1.1.1 24
[R5]interface GigabitEthernet0/0/2 [R5- GigabitEthernet0/0/2]ip address 45.1.1.1 24
[R6]interface GigabitEthernet0/0/2 [R6- GigabitEthernet0/0/2]ip address 46.1.1.1 24
[R7]interface GigabitEthernet0/0/2 [R7- GigabitEthernet0/0/2]ip address 47.1.1.1 24
在ping一下是否通(越是在大的实验越要进行ping) 例如:在R4中ping34.1.1.1 24,45.1.1.1 24,46.1.1.1 24,47.1.1.1 24
再给R3 R5 R6 R7 写缺省 [R3]ip route-static 0.0.0.0 0 34.1.1.2 [R5]ip route-static 0.0.0.0 0 45.1.1.2 [R6]ip route-static 0.0.0.0 0 46.1.1.2 [R7]ip route-static 0.0.0.0 0 47.1.1.2
在ping一下保证是否联通(越是在大的实验越要进行ping) 在R3上ping 45.1.1.1,46.1.1.1,47.1.1.1,
[R3]interface Tunnel 0/0/0 [R3-Tunnel0/0/0]ip address 172.16.0.129 19 [R3-Tunnel0/0/0]tunnel-protocol gre p2mp [R3-Tunnel0/0/0]source 34.1.1.1(写接口也行,接口的IP也行) [R3-Tunnel0/0/0]nhrp entry multicast dynamic [R3-Tunnel0/0/0]nhrp network-id 100
[R5]interface Tunnel 0/0/0 [R5-Tunnel0/0/0]ip address 172.16.0.130 19 [R5-Tunnel0/0/0]tunnel-protocol gre p2mp [R5-Tunnel0/0/0]source 45.1.1.1 [R5-Tunnel0/0/0]nhrp entry 172.16.0.129 34.1.1.1 register [R5-Tunnel0/0/0]nhrp network-id 100
[R6]interface Tunnel 0/0/0 [R6-Tunnel0/0/0]ip address 172.16.0.131 19 [R6-Tunnel0/0/0]tunnel-protocol gre p2mp [R6-Tunnel0/0/0]source GigabitEthernet0/0/2(46.1.1.1) [R6-Tunnel0/0/0]nhrp entry 172.16.0.129 34.1.1.1 register [R6-Tunnel0/0/0]nhrp network-id 100
[R7]interface Tunnel 0/0/0 [R7-Tunnel0/0/0]ip address 172.16.0.132 19 [R7-Tunnel0/0/0]tunnel-protocol gre p2mp [R7-Tunnel0/0/0]source 47.1.1.1 [R7-Tunnel0/0/0]nhrp entry 172.16.0.129 34.1.1.1 register [R7-Tunnel0/0/0]nhrp network-id 100
检查一下进行ping 在R3中ping 172.16.0.130,172.16.0.131,172.16.0.132
在进行其他点ip配置 [R5]interface loopback 0 [R5-loopback0]ip address 172.16.1.1 25
[R6]interface loopback 0 [R6-loopback0]ip address 172.16.1.129 25
[R7]interface loopback 0 [R7-loopback0]ip address 172.16.2.1 25 在配区域1 [R1]interface loopback 0 [R1-loopback0]ip address 172.16.33.1 25
[R2]interface loopback 0 [R2-loopback0]ip address 172.16.33.129 25
[R3]interface loopback 0 [R3-loopback0]ip address 172.16.34.1 25
[R1]interface GigabitEthernet0/0/0 [R1-GigabitEthernet0/0/0]ip address 172.16.32.129 29
[R2]interface GigabitEthernet0/0/0 [R2-GigabitEthernet0/0/0]ip address 172.16.32.130 29
[R3]interface GigabitEthernet0/0/0 [R3-GigabitEthernet0/0/0]ip address 172.16.32.131 29 在进行测试 在R1中ping 172.16.32.130,172.16.32.131
在配区域2 [R11]interface loopback 0 [R11-loopback0]ip address 172.16.65.1 25
[R6]interface GigabitEthernet0/0/0 [R6-GigabitEthernet0/0/0]ip address 172.16.64.1 30
[R11]interface GigabitEthernet0/0/0 [R11-GigabitEthernet0/0/0]ip address 172.16.64.2 30
[R11]interface GigabitEthernet0/0/1 [R11-GigabitEthernet0/0/1]ip address 172.16.64.5 30
[R12]interface GigabitEthernet0/0/0 [R12-GigabitEthernet0/0/0]ip address 172.16.64.6 30 在进行测试 在R11上ping172.16.64.1,172.16.64.6
给R12配俩个环回 [R12]interface loopback 0 [R12-loopback0]ip address 172.16.160.1 20 [R12]interface loopback 1 [R12-loopback1]ip address 172.16.176.1 20
配区域3 [R8]interface loopback 0 [R8-loopback0]ip address 172.16.97.1 29
[R7]interface GigabitEthernet0/0/1 [R7-GigabitEthernet0/0/1]ip address 172.16.96.1 30
[R8]interface GigabitEthernet0/0/0 [R8-GigabitEthernet0/0/0]ip address 172.16.96.2 30
[R8]interface GigabitEthernet0/0/1 [R8-GigabitEthernet0/0/1]ip address 172.16.96.5 30
[R9]interface GigabitEthernet0/0/0 [R9-GigabitEthernet0/0/0]ip address 172.16.96.6 30 在进行测试 在R8上ping 172.16.96.1,172.16.96.6
在配区域4 [R9]interface loopback 0 [R9-loopback0]ip address 172.16.129.1 25
[R10]interface GigabitEthernet0/0/0 [R10-GigabitEthernet0/0/0]ip address 172.16.128.2 30
[R9]interface GigabitEthernet0/0/1 [R9-GigabitEthernet0/0/1]ip address 172.16.128.1 30
[R10]interface loopback 0 [R10-loopback0]ip address 172.16.129.129 25 在进行测试 在R9上ping 172.16.128.2
陪完IP后起动ospf 进行宣告: [R1]ospf 1 router-id 1.1.1.1 [R1-ospf-1]area 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]area 1 [R3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.3.255(这个包含俩个,是这俩个的汇总)
[R3]ospf 1 router-id 3.3.3.3 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]network 172.16.0.129 0.0.0.0
[R5]ospf 1 router-id 5.5.5.5 [R5-ospf-1]area 0 [R5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
[R6]ospf 1 router-id 6.6.6.6 [R6-ospf-1]area 0 [R6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.1.255
[R6]ospf 1 router-id 6.6.6.6 [R6-ospf-1]area 2 [R6-ospf-1-area-0.0.0.2]network 172.16.64.1 0.0.0.0
[R7]ospf 1 router-id 7.7.7.7 [R7-ospf-1]area 0 [R7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.3.255
[R7]ospf 1 router-id 7.7.7.7 [R7-ospf-1]area 3 [R7-ospf-1-area-0.0.0.3]network 172.16.96.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.96.6 0.0.0.0
[R9]ospf 1 router-id 9.9.9.9 [R9-ospf-1]area 4 [R9-ospf-1-area-0.0.0.4]network 172.16.128.0 0.0.1.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
[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.64.6 0.0.0.0
[R12]rip 1 [R12-rip-1]ver 2 [R12-rip-1]network 172.16.0.0
因为是点到点,所以邻居不全,要改工作方式 [R3]interface Tunnel 0/0/0 [R3-Tunnel 0/0/0]ospf network-type broadcast
[R5]interface Tunnel 0/0/0 [R5-Tunnel 0/0/0]ospf network-type broadcast
[R6]interface Tunnel 0/0/0 [R6-Tunnel 0/0/0]ospf network-type broadcast
[R7]interface Tunnel 0/0/0 [R7-Tunnel 0/0/0]ospf network-type broadcast 因为在3上可以互相看到5,6,7,但是5,6,7看不到互相,让5,6,7放弃选举,让3当dr,中心到站点处理方案 [R5]interface Tunnel 0/0/0 [R5-Tunnel 0/0/0]ospf dr-priority 0
[R6]interface Tunnel 0/0/0 [R6-Tunnel 0/0/0]ospf dr-priority 0
[R7]interface Tunnel 0/0/0 [R7-Tunnel 0/0/0]ospf dr-priority 0
路由表不全,因为area4和rip的路由表没有传入上面的路由哦,上面的路由也不回发给他们俩个。需要重发布 在rip中 [R12]ospf 1 [R12-ospf-1]import-rip 1(将rip的路由发上去) 在area4中需要多进程双向重发布,但是可以将下面的路由重单发布上去,将上面的路由发到下面来,只需要一个缺省就够了 [R9]ospf 1 [R9-ospf-1]area 4 [R9-ospf-1-area-0.0.0.4]undo network 172.16.128.0 0.0.1.255(9,10的邻居关系断了) 在进入进程2 [R9]ospf 12 [R9-ospf-2]area 4 [R9-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.1.255 在R9中进程1和上面沟通,进程2和下面沟通 [R9]ospf 1 [R9-ospf-1]import-route ospf 2(将下面的路由重单发布上去) { [R9]ospf 2 [R9-ospf-2]import-route ospf 1(将上面的路由重单发布下去) }为双进程重发布 调节途殊区域后在配缺省
减少LSA更新量: 1.非骨干区域通调特殊区域来减少更新量; 2.骨干区域通过汇总来减少更新量 查看五的路由为:
我们可以将a1 2 3 4 以及rip汇成五条路由传入给R5 域内: [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
[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
[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
域外: [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 在到五上查看路由为: 为什么会出现多一条域外路由----倒数第四条。rip宣告实际上是三个网段(俩个换回以及一个接口)倒数第四条,倒数第一二调为rip的俩个换回,倒数第四条为R12的左边接口,在重发布中倒数第四条在R1-11中因为他可以通过LSA1,2,3类获取,所以在R1-11中路由表没有出现,但是在发送的数据库中任然存在。
特殊区域: 区域1变成完全末梢—将四五类全部去掉 [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
区域2为完全NSSA [R12]ospf 1 [R12-ospf-1]area 2 [R12-ospf-1-area-0.0.0.2]nssa
[R11]ospf 1 [R11-ospf-1]area 2 [R11-ospf-1-area-0.0.0.2]nssa
[R6]ospf 1 [R6-ospf-1]area 2 [R6-ospf-1-area-0.0.0.2]nssa no-summary
区域3完全NSSA [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
在来配R10的缺省 [R9]ospf 2 [R9-ospf-2]default-route-advertise
所有设备均可访问R4的环回: 先需要缺省来指向各个零界点,但是前面做了特殊区域时做了缺省现在只需要做nat: [R3]acl 2000 [R3-acl-basic-2000]rule permit scoure 172.16.0.0 0.0.255.255
[R3]interface GigabitEthernet0/0/2 [R3-GigabitEthernet0/0/2]nat outbound 2000
[R6]acl 2000 [R6-acl-basic-2000]rule permit scoure 172.16.0.0 0.0.255.255
[R6]interface GigabitEthernet0/0/2 [R6-GigabitEthernet0/0/2]nat outbound 2000
[R7]acl 2000 [R7-acl-basic-2000]rule permit scoure 172.16.0.0 0.0.255.255
[R7]interface GigabitEthernet0/0/2 [R7-GigabitEthernet0/0/2]nat outbound 2000
在进行测试: 在R12上进行ping4的换回 ping 4.4.4.4
还有防环,思科自己会有,华为不会。汇总的部分需要空接口,防止成环。 [R3]ip route-static 172.16.32.0 19 NULL 0 [R6]ip route-static 172.16.64.0 19 NULL 0 [R7]ip route-static 172.16.96.0 19 NULL 0 [R9]ip route-static 172.16.128.0 19 NULL 0 [R12]ip route-static 172.16.160.0 19 NULL 0
|