目录
题目:
步骤一:拓扑设计,地址规划
地址规划:
有题意知:整个OSPF环境基于172.16.0.0/16划分。则据提意划分出子网掩码长度为20的,十六个网段,如下:
一开始先根据协议不同进行第一次子网划分
172.16.0.0/17 OSPF
172.16.128.0/17 RIP
OSPF内按区域划分子网:
172.16.0.0/20 area0
172.16.16.0/20 area1
172.16.32.0/20 area2
172.16.48.0/20 area3
172.16.64.0/20 area4
保留:
172.16.80.0/20
172.16.96.0/20
172.16.112.0/20area0
172.16.0.0 24
172.16.1.0 24
172.16.2.0 24
172.16.3.0 24
......
172.16.15.0 24
area1
172.16.16.0 24
172.16.17.0 24
172.16.18.0 24
area2
172.16.32.0 24
172.16.33.0 24
以此类推
拓扑设计:
步骤三:配置IP地址
# R1
interface GigabitEthernet0/0/0
ip address 172.16.16.1 255.255.255.248
interface LoopBack0
ip address 172.16.17.1 255.255.255.0
# R2
interface GigabitEthernet0/0/0
ip address 172.16.16.2 255.255.255.248
interface LoopBack0
ip address 172.16.18.1 255.255.255.0
# R3
interface Serial4/0/0
ip address 34.0.0.1 255.255.255.0
interface GigabitEthernet0/0/0
ip address 172.16.16.3 255.255.255.248
interface LoopBack0
ip address 172.16.19.1 255.255.255.0
# R4(ISP)
interface Serial3/0/0
ip address 46.0.0.2 255.255.255.0
interface Serial4/0/0
ip address 34.0.0.2 255.255.255.0
interface Serial4/0/1
ip address 45.0.0.2 255.255.255.0
interface GigabitEthernet0/0/0
ip address 47.0.0.2 255.255.255.0
interface LoopBack0
ip address 4.4.4.4 255.255.255.0
# R5
interface Serial4/0/0
ip address 45.0.0.1 255.255.255.0
interface LoopBack0
ip address 172.16.1.1 255.255.255.0
# R6
interface Serial4/0/0
ip address 46.0.0.1 255.255.255.0
interface GigabitEthernet0/0/0
ip address 172.16.32.1 255.255.255.252
interface LoopBack0
ip address 172.16.2.1 255.255.255.0
# R7
interface GigabitEthernet0/0/0
ip address 47.0.0.1 255.255.255.0
interface GigabitEthernet0/0/1
ip address 172.16.48.1 255.255.255.252
interface LoopBack0
ip address 172.16.3.1 255.255.255.0
# R8
interface GigabitEthernet0/0/0
ip address 172.16.48.2 255.255.255.252
interface GigabitEthernet0/0/1
ip address 172.16.48.5 255.255.255.252
interface LoopBack0
ip address 172.16.49.1 255.255.255.0
# R9
interface GigabitEthernet0/0/0
ip address 172.16.48.6 255.255.255.252
interface GigabitEthernet0/0/1
ip address 172.16.64.1 255.255.255.252
interface LoopBack0
ip address 172.16.65.1 255.255.255.0
# R10
interface GigabitEthernet0/0/0
ip address 172.16.64.2 255.255.255.252
interface LoopBack0
ip address 172.16.66.1 255.255.255.0
# R11
interface GigabitEthernet0/0/0
ip address 172.16.32.2 255.255.255.252
#interface GigabitEthernet0/0/1
ip address 172.16.32.5 255.255.255.252
interface LoopBack0
ip address 172.16.33.1 255.255.255.0
# R12
interface GigabitEthernet0/0/0
ip address 172.16.32.6 255.255.255.252
interface LoopBack0
ip address 172.16.128.1 255.255.192.0
interface LoopBack1
ip address 172.16.192.1 255.255.192.0
步骤四:构建 MGRE环境
设置中心站点(R3上进行配置)
查看注册情况:display nhrp peer all
interface Tunnel0/0/0
ip address 172.16.0.1 255.255.255.0
tunnel-protocol gre p2mp
source 34.0.0.1
nhrp entry multicast dynamic
#
ip route-static 0.0.0.0 0.0.0.0 34.0.0.2
配置分支站点(R5 R6 R7):
R5
interface Tunnel0/0/0
ip address 172.16.0.2 255.255.255.0
tunnel-protocol gre p2mp
source Serial4/0/0
nhrp entry 172.16.0.1 34.0.0.1 register
#
ip route-static 0.0.0.0 0.0.0.0 45.0.0.2
R6
interface Tunnel0/0/0
ip address 172.16.0.3 255.255.255.0
tunnel-protocol gre p2mp
source Serial4/0/0
nhrp entry 172.16.0.1 34.0.0.1 register
#
ip route-static 0.0.0.0 0.0.0.0 46.0.0.2
R7
interface Tunnel0/0/0
ip address 172.16.0.4 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
nhrp entry 172.16.0.1 34.0.0.1 register
#
ip route-static 0.0.0.0 0.0.0.0 47.0.0.2
步骤五:配置OSPF
配置完成后用 display ospf peer brief 随时查看配置状态
使用display ospf routing 查看路由
R1
ospf 1 router-id 1.1.1.1
area 0.0.0.1
network 172.16.16.1 0.0.0.0
network 172.16.17.1 0.0.0.0
R2
ospf 1 router-id 2.2.2.2
area 0.0.0.1
network 172.16.16.2 0.0.0.0
network 172.16.18.1 0.0.0.0
R3
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 172.16.0.1 0.0.0.0
area 0.0.0.1
network 172.16.16.3 0.0.0.0
network 172.16.19.1 0.0.0.0
R5
ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 172.16.0.2 0.0.0.0
network 172.16.1.1 0.0.0.0
R6
ospf 1 router-id 6.6.6.6
area 0.0.0.0
network 172.16.0.3 0.0.0.0
network 172.16.2.1 0.0.0.0
area 0.0.0.2
network 172.16.32.1 0.0.0.0
R7
ospf 1 router-id 7.7.7.7
area 0.0.0.0
network 172.16.0.4 0.0.0.0
network 172.16.3.1 0.0.0.0
area 0.0.0.3
network 172.16.48.1 0.0.0.0
R8
ospf 1 router-id 8.8.8.8
area 0.0.0.3
network 172.16.48.2 0.0.0.0
network 172.16.48.5 0.0.0.0
network 172.16.49.1 0.0.0.0
R9
ospf 1 router-id 9.9.9.9
area 0.0.0.3
network 172.16.48.6 0.0.0.0
#
ospf 2
area 0.0.0.4
network 172.16.64.1 0.0.0.0
network 172.16.65.1 0.0.0.0
[R9-ospf-2]default-route-advertise always
R10
ospf 2
area 0.0.0.4
network 172.16.64.2 0.0.0.0
network 172.16.66.1 0.0.0.0
R11
ospf 1 router-id 11.11.11.11
area 0.0.0.2
network 172.16.32.2 0.0.0.0
network 172.16.32.5 0.0.0.0
network 172.16.33.1 0.0.0.0
R12
ospf 1 router-id 12.12.12.12
area 0.0.0.2
network 172.16.32.6 0.0.0.0
#
rip 1
version 2
network 172.16.0.0
MGER环境下使用OSPF后续补充配置命令(三种)
1.修改接口网络类型: 进入对应接口(隧道接口)后 ospf network-type ~类型~
若类型修改为p2mp则不需要进行一下俩个步骤,若修改为broadcast 则需要进行一下俩个步骤
2.打开伪广播 :进入对应接口(中心站点隧道)后 nhrp entry multicast dynamic
3.强制规定DR: 更改一些接口优先级,以达让某些路由器接口不参与选举
进入对应接口(隧道接口)后 ospf dr-priority 0
步骤六:加快收敛
修改hello时间:每个使用OSPF协议的路由器接口均需要修改:ospf timer hello 5
步骤七:给R9 R12做双向重发布
R9
ospf 1 router-id 9.9.9.9
import-route ospf 2
#
ospf 2
import-route ospf 1
R12
ospf 1 router-id 12.12.12.12
import-route rip 1
#
rip 1
import-route ospf 1
步骤八:区域汇总
区域汇总:
# R3
[R3-ospf-1-area-0.0.0.1]abr-summary 172.16.16.0 255.255.240.0
# R9
[R9-ospf-1]asbr-summary 172.16.64.0 255.255.240.0
# R12
[R12-ospf-1]asbr-summary 172.16.128.0 255.255.128.0
做特殊区域减少LSA更新量:
给area3 area2 做完全NSSA,给area1 做完全STUD区域。
命令名为进入area3 area2内的所有路由器OSPF协议对于区域界面,在ASBR上输入nssa no-summary。其于输入nssa
命令名为进入area1 内的所有路由器OSPF协议对于区域界面,在ASBR上输入stub no-summary
其于输入stub
步骤九:给MGRE环境配置NAT
给R3 R5 R6 R7配置
acl 2000
rule 1 permit source any
int g 0/0/1 或者 int s 4/0/0(具体看接口)
nat outbound 2000
步骤十:保证更新安全(认证)
给每个路由器配置:authentication-mode md5 1 cipher 123456