OSPF大实验
1.配置IP
2.通公网(或私网)–(通公网)这里可以配置静态缺省
ip route-static 0.0.0.0 0 (下一跳)
--在R3,R5,R6,R7上配置
3.整个私网环境基于OSPF–进行宣告(以便路由器后期交互LSD)–私网通
area0
[R5-ospf-1-area-0.0.0.0]net 172.16.3.0 0.0.0.255
[R6-ospf-1-area-0.0.0.0]net 172.16.4.0 0.0.0.255
[R7-ospf-1-area-0.0.0.0]net 172.16.5.0 0.0.0.255
area1
[R1-ospf-1-area-0.0.0.1]net 172.16.34.0 0.0.0.255
[R1-ospf-1-area-0.0.0.1]net 172.16.33.0 0.0.0.255
[R2-ospf-1-area-0.0.0.1]net 172.16.33.0 0.0.0.255
[R2-ospf-1-area-0.0.0.1]net 172.16.35.0 0.0.0.255
[R3-ospf-1-area-0.0.0.1]net 172.16.36.0 0.0.0.255
[R3-ospf-1-area-0.0.0.1]net 172.16.33.3 0.0.0.0
area2
[R6-ospf-1-area-0.0.0.2]net 172.16.65.1 0.0.0.0
[R11-ospf-1-area-0.0.0.2]net 172.16.65.5 0.0.0.0
[R11-ospf-1-area-0.0.0.2]net 172.16.65.2 0.0.0.0
[R12-ospf-1-area-0.0.0.2]net 172.16.65.6 0.0.0.0
[R11-ospf-1-area-0.0.0.2]net 172.16.66.6 0.0.0.0
area3
[R7-ospf-1-area-0.0.0.3]net 172.16.97.1 0.0.0.0
[R8-ospf-1-area-0.0.0.3]net 172.16.97.5 0.0.0.0
[R8-ospf-1-area-0.0.0.3]net 172.16.97.2 0.0.0.0
[R8-ospf-1-area-0.0.0.3]net 172.16.98.8 0.0.0.0
[R9-ospf-1-area-0.0.0.3]net 172.16.97.6 0.0.0.0
area4
[R9-ospf-2-area-0.0.0.4]net 172.16.129.1 0.0.0.0
[R9-ospf-2-area-0.0.0.4]net 172.16.130.9 0.0.0.0
[R10-ospf-2-area-0.0.0.4]net 172.16.129.2 0.0.0.0
[R10-ospf-2-area-0.0.0.4]net 172.16.131.10 0.0.0.0将ospf路由引入:
[R9-ospf-1]import-route ospf 2
[R9-ospf-1]ospf 2
[R9-ospf-2]import-route ospf 1
rip
[R12]rip
[R12-rip-1]v 2
[R12-rip-1]undo summary
[R12-rip-1]network 192.16.0.0将rip引入:
[R12-ospf-1]import-route rip
4.配置MGRE环境–R3为中心站点
[R3]int t0/0/0
[R3-Tunnel0/0/0]ip add 172.16.6.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source s4/0/0
[R3-Tunnel0/0/0]nhrp network-id 1000
[R3-Tunnel0/0/0]nhrp entry multicast dynamic [R5]int t0/0/0
[R5-Tunnel0/0/0]ip add 172.16.6.5 24
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source s4/0/0
[R5-Tunnel0/0/0]nhrp network-id 1000
[R5-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register [R6]int t0/0/0
[R6-Tunnel0/0/0]ip add 172.16.6.6 24
[R6-Tunnel0/0/0]tunnel-protocol gre p2mp
[R6-Tunnel0/0/0]source s4/0/0
[R6-Tunnel0/0/0]nhrp network-id 1000
[R6-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register [R7]int t0/0/0
[R7-Tunnel0/0/0]ip add 172.16.6.7 24
[R7-Tunnel0/0/0]tunnel-protocol gre p2mp
[R7-Tunnel0/0/0]source g0/0/0
[R7-Tunnel0/0/0]nhrp network-id 1000
[R7-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register
宣告隧道口:
[R3-ospf-1-area-0.0.0.0]net 172.16.6.3 0.0.0.0[R5-ospf-1-area-0.0.0.0]net 172.16.6.5 0.0.0.0[R6-ospf-1-area-0.0.0.0]net 172.16.6.6 0.0.0.0[R7-ospf-1-area-0.0.0.0]net 172.16.6.7 0.0.0.0
5.避免点到点:
[R3-Tunnel0/0/0]ospf network-type broadcast[R5-Tunnel0/0/0]ospf network-type broadcast [R6-Tunnel0/0/0]ospf network-type broadcast [R7-Tunnel0/0/0]ospf network-type broadcast
6.防止选举错误:
[R5-Tunnel0/0/0]ospf dr-priority 0[R6-Tunnel0/0/0]ospf dr-priority 0[R7-Tunnel0/0/0]ospf dr-priority 0
7.esay-ip—实现公网IP 地址实现与私网IP 地址之间的映射
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R3-acl-basic-2000]int s4/0/0
[R3-Serial4/0/0]nat outbound 2000[R5]acl 2000
[R5-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R5-acl-basic-2000]int s4/0/0
[R5-Serial4/0/0]nat outbound 2000[R6]acl 2000
[R6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R6-acl-basic-2000]int s4/0/0
[R6-Serial4/0/0]nat outbound 2000[R7]acl 2000
[R7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R7-acl-basic-2000]int g0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000
区域聚合–减少LSA的更新量:
[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]abr-su
[R3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]abr-
[R6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0[R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]abr-
[R7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0[R9]ospf 1
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.255.0
8.特殊区域–减少LSA的更新量:
area 1
[R1]ospf 1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]stub no
[R1-ospf-1-area-0.0.0.1]stub no-summary [R2]ospf 1
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]stub no
[R2-ospf-1-area-0.0.0.1]stub no-summary [R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]stub no-summary
area 2
[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]nssa no-summary [R11]ospf 1
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]nssa no-summary [R12]ospf 1
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]nssa no-summary
area 3
[R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]nssa no-summary[R8]ospf 1
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]nssa no-summary[R9]ospf 1
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]nssa no-summary
9.手动下发缺省:
[R9-ospf-2]default-route-advertise
10.加快收敛—通过设置hello包更新时间加快收敛
a 1
[R1-GigabitEthernet0/0/0]ospf timer hello 5
[R2-GigabitEthernet0/0/0]ospf timer hello 5
[R3-GigabitEthernet0/0/0]ospf timer hello 5
a 2
[R6-GigabitEthernet0/0/0]ospf timer hello 5
[R11-GigabitEthernet0/0/1]ospf timer hello 5
[R11-GigabitEthernet0/0/0]ospf timer hello 5
[R12-GigabitEthernet0/0/0]ospf timer hello 5
a 3
[R7-GigabitEthernet0/0/1]ospf timer hello 5
[R8-GigabitEthernet0/0/0]ospf timer hello 5
[R8-GigabitEthernet0/0/1]ospf timer hello 5
[R9-GigabitEthernet0/0/0]ospf timer hello 5
a 4
[R9-GigabitEthernet0/0/1]ospf timer hello 5
[R10-GigabitEthernet0/0/0]ospf timer hello 5
11.区域认证–保障更新安全
a 1
[R1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 12345
[R2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 12345
[R3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 12345
a 2
[R6-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 12345
[R11-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 12345
[R12-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 12345
a 3
[R7-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 12345
[R8-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 12345
[R9-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 12345
a 4
[R9-ospf-2-area-0.0.0.4]authentication-mode md5 1 cipher 12345
[R10-ospf-2-area-0.0.0.4]authentication-mode md5 1 cipher 12345
全网通(验证):