拓扑结构:
网络要求:
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,全网可达
网络配置:
接口配置:
R1:
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 172.16.33.1 29
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 172.16.34.1 24
R2:
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 172.16.33.2 29
[r2]interface LoopBack 0
[r2-LoopBack0]ip address 172.16.35.1 24
R3:
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]ip address 43.0.0.1 24
[r3]ip route-static 0.0.0.0 0 43.0.0.2
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 172.16.33.3 29
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 172.16.36.1 24
R4:
[isp]interface Serial 4/0/0
[isp-Serial4/0/0]ip address 43.0.0.2 24
[isp]interface Serial 4/0/1
[isp-Serial4/0/1]ip address 45.0.0.2 24
[isp]interface Serial 3/0/0
[isp-Serial3/0/0]ip address 46.0.0.2 24
[isp]interface GigabitEthernet 0/0/0
[isp-GigabitEthernet0/0/0]ip address 47.0.0.2 24
[isp]interface l
[isp]interface LoopBack 0[isp-LoopBack0]ip address 100.0.0.1 24
R5:
[r5]interface Serial 4/0/0
[r5-Serial4/0/0]ip address 45.0.0.1 24
[r5]ip route-static 0.0.0.0 0 45.0.0.2
[r5]interface LoopBack 0
[r5-LoopBack0]ip address 172.16.2.1 24
R6:
[r6]interface Serial 4/0/0
[r6-Serial4/0/0]ip address 46.0.0.1 24
[r6]ip route-static 0.0.0.0 0 46.0.0.2
[r6]interface LoopBack 0
[r6-LoopBack0]ip address 172.16.3.1 24
[r6]interface GigabitEthernet 0/0/0
[r6-GigabitEthernet0/0/0]ip address 172.16.64.1 30
R7:
[r7]interface GigabitEthernet 0/0/0
[r7-GigabitEthernet0/0/0]ip address 47.0.0.1 24
[r7]ip route-static 0.0.0.0 0 47.0.0.2
[r7]interface LoopBack 0
[r7-LoopBack0]ip address 172.16.4.1 24
[r7]interface GigabitEthernet 0/0/1
[r7-GigabitEthernet0/0/1]ip address 172.16.96.1 30
R8:
[r8]interface GigabitEthernet 0/0/0
[r8-GigabitEthernet0/0/0]ip address 172.16.96.2 30
[r8]interface GigabitEthernet 0/0/1
[r8-GigabitEthernet0/0/1]ip address 172.16.96.5 30
[r8]interface LoopBack 0
[r8-LoopBack0]ip address 172.16.98.1 24
R9:
[r9]interface GigabitEthernet 0/0/0
[r9-GigabitEthernet0/0/0]ip address 172.16.96.6 30
[r9]interface GigabitEthernet 0/0/1
[r9-GigabitEthernet0/0/1]ip address 172.16.128.1 30
[r9]interface LoopBack 0
[r9-LoopBack0]ip address 172.16.130.1 24
R10:
[r10]interface GigabitEthernet 0/0/0
[r10-GigabitEthernet0/0/0]ip address 172.16.128.2 30
[r10]interface LoopBack 0
[r10-LoopBack0]ip address 172.16.131.1 24
R11:
[r11]interface GigabitEthernet 0/0/0
[r11-GigabitEthernet0/0/0]ip address 172.16.64.2 30
[r11]interface GigabitEthernet 0/0/1
[r11-GigabitEthernet0/0/1]ip address 172.16.64.5 30
[r11]interface LoopBack 0
[r11-LoopBack0]ip address 172.16.66.1 24
R12:
[r12]interface GigabitEthernet 0/0/0
[r12-GigabitEthernet0/0/0]ip address 172.16.64.6 30
[r12]interface LoopBack 0
[r12-LoopBack0]ip address 172.16.160.1 24
[r12]interface LoopBack 1
[r12-LoopBack1]ip address 172.16.161.1 24
使用NAT,使得全网通,能够访问ISP的环路
[r3]acl 2000
[r3-acl-basic-2000]rule permit s 172.16.0.0 0.0.255.255
[r3-Serial4/0/0]nat outbound 2000
MGRE配置 :
R3(中心站点):
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 172.16.1.1 29
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 43.0.0.1
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
R5(分支):
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 172.16.1.2 29
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 45.0.0.1
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 172.16.1.1 43.0.0.1 register
其他分支类似
OSPF配置:
R7:
[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.4 0.0.0.0
[r7-ospf-1-area-0.0.0.0]network 172.16.4.1 0.0.0.0
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]network 172.16.96.1 0.0.0.0
[r7]interface Tunnel 0/0/0
[r7-Tunnel0/0/0]ospf network-type p2mp
R12:
[r12]rip
[r12-rip-1]network 172.16.0.0
[r12]ospf 1 router-id 12.1.1.1
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.2]network 172.16.64.0 0.0.31.255
[r12]ospf
[r12-ospf-1]import-route rip
为了解决不规则区域,采用的是多进程双向重发布
R9:
[r9]ospf 2 router-id 9.9.9.9
[r9-ospf-2]area 0
[r9-ospf-2-area-0.0.0.0]network 172.16.128.0 0.0.31.255
[r9]ospf 1
[r9-ospf-1]import-route ospf 2
R10:
[r10]ospf 2 router-id 10.1.1.1
[r10-ospf-2]area 0
[r10-ospf-2-area-0.0.0.0]network 172.16.128.0 0.0.31.255
OSPF优化:
路由汇总:
域中汇总:
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
[r6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[r7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
域间汇总:
[r12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
[r9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
特殊区域:
区域中的每台路由器都要配置
[r1-ospf-1-area-0.0.0.1]stub
[r3-ospf-1-area-0.0.0.1]stub no-summary
[r12-ospf-1-area-0.0.0.2]nssa
[r6-ospf-1-area-0.0.0.2]nssa no-summary