一、实验要求
1、R4为ISP,其上只能配置IP地址: R4与其他所有直连设备间使用公有
2、R3—R5/6/7为MGRE环境,R3为中心站点
3、整个OSPF环境IP地址为172.16.0.0/16
4、所有设备均可访问R4的环回
5、减少LSA的更新量,加快收敛,保障更新安全
6、全网可达
二、实验步骤
1.IP地址规划
172.16.0.0/16
area 0:172.16.0.0/19
area 1:172.16.32.0/19
area 2:172.16.64.0/19
area 3:172.16.96.0/19
area 4:172.16.128.0/19
rip区域:172.16.160.0/19
配置缺省路由,使公网全网可达
[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
R3—R5/6/7为MGRE环境,R3为中心站点
[R3]interface Tunnel 0/0/0
[R3-Tunnel0/0/0]ip add 172.16.1.1 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 34.1.1.1
[R3-Tunnel0/0/0]nhrp entry multicast dynamic
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]ospf network-type broadcast[R5]interface Tunnel 0/0/0
[R5-Tunnel0/0/0]ip add 172.16.1.2 24
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source GigabitEthernet 0/0/0
[R5-Tunnel0/0/0]nhrp entry 172.16.1.1 34.1.1.1 register
[R5-Tunnel0/0/0]nhrp network-id 100
[R5-Tunnel0/0/0]ospf network-type broadcast
[R5-Tunnel0/0/0]ospf dr-priority 0
[R6]interface Tunnel 0/0/0
[R6-Tunnel0/0/0]ip add 172.16.1.3 24
[R6-Tunnel0/0/0]tunnel-protocol gre p2mp
[R6-Tunnel0/0/0]source GigabitEthernet 0/0/0
on the interface Tunnel0/0/0 has entered the UP state.
[R6-Tunnel0/0/0]nhrp entry 172.16.1.1 34.1.1.1 register
[R6-Tunnel0/0/0]nhrp network-id 100
[R6-Tunnel0/0/0]ospf network-type broadcast
[R6-Tunnel0/0/0]ospf dr-priority 0[R7]interface Tunnel 0/0/0
[R7-Tunnel0/0/0]ip add 172.16.1.4 24
[R7-Tunnel0/0/0]tunnel-protocol gre p2mp
[R7-Tunnel0/0/0]source GigabitEthernet 0/0/0
[R7-Tunnel0/0/0]nhrp entry 172.16.1.1 34.1.1.1 register
[R7-Tunnel0/0/0]nhrp network-id 100
[R7-Tunnel0/0/0]ospf network-type broadcast
[R7-Tunnel0/0/0]ospf dr-priority 0
区域内配置好ospf协议,rip区域配好rip协议
区域0
[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.1.0 0.0.0.255[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.2.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.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.3.0 0.0.0.255
[R6-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.255[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.1.0 0.0.0.255
[R7-ospf-1-area-0.0.0.0]network 172.16.4.0 0.0.0.255
区域1:
[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.48.0 0.0.7.255
[R1-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.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.56.0 0.0.7.255
[R2-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.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.40.0 0.0.7.255
[R3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.255
区域2:
[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.0 0.0.7.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.80.0 0.0.7.255
[R11-ospf-1-area-0.0.0.2]network 172.16.64.0 0.0.7.255
[R11-ospf-1-area-0.0.0.2]network 172.16.72.0 0.0.7.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.72.0 0.0.7.255
区域3
[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.0 0.0.7.255[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.96.0 0.0.7.255
[R8-ospf-1-area-0.0.0.3]network 172.16.104.0 0.0.7.255
[R8-ospf-1-area-0.0.0.3]network 172.16.112.0 0.0.7.255[R9]ospf 1 router-id 9.9.9.9
[R9-ospf-1]area 3
[R9-ospf-1-area-0.0.0.3]network 192.16.104.0 0.0.7.255
区域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.7.255
[R9-ospf-2-area-0.0.0.4]network 172.16.136.0 0.0.7.255[R10]ospf 2 router-id 10.10.10.10
[R10-ospf-2]area 4
[R10-ospf-2-area-0.0.0.4]network 172.16.144.0 0.0.7.255
[R10-ospf-2-area-0.0.0.4]network 172.16.136.0 0.0.7.255
rip区域:
[R12]rip
[R12-rip-1]version 2
[R12-rip-1]network 172.16.0.0
远离骨干区域的非骨干区域,运用多进程双向重发布
[R9]ospf 2
[R9-ospf-2]import-route ospf 1
[R9]ospf 1
[R9-ospf-1]import-route ospf 2
rip区域
[R12]rip
[R12-rip-1]import-route ospf 1
[R12]ospf 1
[R12-ospf-1]import-route rip 1
在边界路由器上做NAT
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.32.0 0.0.7.255
[R3]int g 0/0/1
[R3-GigabitEthernet0/0/1]nat outbound 2000
[R3]ospf
[R3-ospf-1]default-route-advertise always[R6]acl 2000
[R6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]nat outbound 2000
[R6]ospf
[R6-ospf-1]default-route-advertise always[R7]acl 2000
[R7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000
[R7]ospf
[R7-ospf-1]default-route-advertise always[R10]ip route-static 0.0.0.0 0 172.16.136.1
[R12]ip route-static 0.0.0.0 0 172.16.72.1