实验题目:OSPF 特性配置
实验需求
1、IP地址自行规划
2、ospf区域规划如图所示
3、R1上有图例地址,引入到ospf,汇总
4、R4上有图例地址,宣告进ospf,汇总
5、area1为NSSA区域,area4为totally-stub
6、area3要求做一个v-link
7、area0要求做一个区域认证
8、R4的loop4宣告进ospf,但是不能被其他所有路由器访问
9、该通讯的通讯,不该通讯的不通讯。
实验过程
配置IP
[R1]int g0/0
[R1-GigabitEthernet0/0]ip add 192.168.11.1 24
[R1-GigabitEthernet0/0]qu
[R1]int lo0
[R1-LoopBack0]ip add 1.1.1.1 32
[R1-LoopBack0]q
[R1]ospf
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]netw 192.168.11.0 0.0.0.255
[R1-ospf-1-area-0.0.0.1]netw 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.1]qu
[R2]int g0/0
[R2-GigabitEthernet0/0]ip add 192.168.11.2 24
[R2]int g0/1
[R2-GigabitEthernet0/1]ip add 192.168.88.2 24
[R2-GigabitEthernet0/0]int g0/2
[R2-GigabitEthernet0/2]ip add 192.168.22.2 24
[R2]int lo0
[R2-LoopBack0]ip add 2.2.2.2 32
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]netw 192.168.11.0 0.0.0.255
[R2-ospf-1-area-0.0.0.1]qu
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]netw 192.168.88.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]netw 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]qu
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]netw 192.168.22.0 0.0.0.255
[R2-ospf-1-area-0.0.0.2]qu
[R3]int g0/0
[R3-GigabitEthernet0/0]ip add 192.168.88.3 24
[R3-GigabitEthernet0/0]int g0/1
[R3-GigabitEthernet0/1]ip add 192.168.33.3 24
[R3-GigabitEthernet0/1]qu
[R3]int lo0
[R3-LoopBack0]ip add 3.3.3.3 32
[R3-LoopBack0]qu
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]netw 192.168.88.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]netw 3.3.3.3 0.0.0.0
[R3-ospf-1]area 3
[R3-ospf-1-area-0.0.0.3]netw 192.168.33.0 0.0.0.255
[R3-ospf-1-area-0.0.0.3]qu
[R4]int g0/0
[R4-GigabitEthernet0/0]ip add 192.168.22.4 24
[R4-GigabitEthernet0/0]qu
[R4]int lo0
[R4-LoopBack0]ip add 4.4.4.4 32
[R4-LoopBack0]qu
[R4]ospf
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]netw 192.168.22.0 0.0.0.255
[R4-ospf-1-area-0.0.0.2]netw 4.4.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.2]qu
[R5]int g0/0
[R5-GigabitEthernet0/0]ip add 192.168.33.5 24
[R5-GigabitEthernet0/0]int g0/1
[R5-GigabitEthernet0/1]ip add 192.168.44.5 24
[R5-GigabitEthernet0/1]qu
[R5-ospf-1]int lo0
[R5-LoopBack0]ip add 5.5.5.5 32
[R5-LoopBack0]qu
[R5]ospf
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]are 3
[R5-ospf-1-area-0.0.0.3]netw 5.5.5.5 0.0.0.0
[R5-ospf-1-area-0.0.0.3]netw 192.168.33.0 0.0.0.255
[R5-ospf-1]area 4
[R5-ospf-1-area-0.0.0.4]netw 192.168.44.0 0.0.0.255
[R5-ospf-1-area-0.0.0.4]qu
[R6]int g 0/1
[R6-GigabitEthernet0/1]ip add 192.168.44.6 24
[R6-GigabitEthernet0/1]qu
[R6]int lo0
[R6-LoopBack0]ip add 6.6.6.6 32
[R6-LoopBack0]qu
[R6]ospf
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]area 4
[R6-ospf-1-area-0.0.0.4]
[R6-ospf-1-area-0.0.0.4]netw 6.6.6.6 0.0.0.0
[R6-ospf-1-area-0.0.0.4]netw 192.168.44.0 0.0.0.255
[R6-ospf-1-area-0.0.0.4]qu
[R6-ospf-1]qu
R1上有图例地址,引入到ospf,汇总
[R1-LoopBack0]int lo1
[R1-LoopBack1]ip add 100.100.100.100 32
[R1-LoopBack1]int lo2
[R1-LoopBack2]ip add 10.10.10.1 32
[R1-LoopBack2]int lo3
[R1-LoopBack3]ip add 10.10.10.2 32
[R1-LoopBack3]int lo4
[R1-LoopBack4]ip add 10.10.10.3 32
[R1-LoopBack4]
[R1]ospf
[R1-ospf-1]impo
[R1-ospf-1]import-route dir
[R1-ospf-1]import-route direct
[R1-ospf-1]asbr-summary 10.10.10.0 22
R4上有图例地址,宣告进ospf,汇总
[R4]int lo1
[R4-LoopBack1]ip add 172.16.1.1 32
[R4-LoopBack1]int lo2
[R4-LoopBack2]ip add 172.16.1.2 32
[R4-LoopBack2]int lo3
[R4-LoopBack3]ip add 172.16.1.3 32
[R4-LoopBack3]int lo4
[R4-LoopBack4]ip add 40.40.40.40 32
[R4]ospf
[R4-ospf-1]are 2
[R4-ospf-1-area-0.0.0.2]netw 172.16.1.1 0.0.0.0
[R4-ospf-1-area-0.0.0.2]netw 172.16.1.2 0.0.0.0
[R4-ospf-1-area-0.0.0.2]netw 172.16.1.3 0.0.0.0
[R4-ospf-1-area-0.0.0.2]netw 40.40.40.40 0.0.0.0
area1为NSSA区域,
[R1]ospf 1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]nssa
[R2]ospf 1
[R2-ospf-1]are 1
[R2-ospf-1-area-0.0.0.1]nssa
area4为totally-stub
[R5]ospf 1
[R5-ospf-1]are 4
[R5-ospf-1-area-0.0.0.4]stub no-
[R5-ospf-1-area-0.0.0.4]stub no-summary
[R6]ospf
[R6-ospf-1]area 4
[R6-ospf-1-area-0.0.0.4]stub no-
[R6-ospf-1-area-0.0.0.4]stub no-summary
area3要求做一个v-link
[R3]ospf
[R3-ospf-1]are 3
[R3-ospf-1-area-0.0.0.3]vlink-peer 5.5.5.5
[R5]ospf
[R5-ospf-1]are 3
[R5-ospf-1-area-0.0.0.3]vlink-peer 3.3.3.3
7、area0要求做一个区域认证
[R2]ospf
[R2-ospf-1]are 0
[R2-ospf-1-area-0.0.0.0]authentication-mode simple plain 123456
[R3-ospf-1-area-0.0.0.3]are 0
[R3-ospf-1-area-0.0.0.0]authentication-mode simple plain 123456
配置 acl ,使其他路由不能访问 R4 的 40.40.40.40
[R2]acl basic 2000
[R2-acl-ipv4-basic-2000]rule d
[R2-acl-ipv4-basic-2000]rule deny s
[R2-acl-ipv4-basic-2000]rule deny source 40.40.40.40 0.0.0.0
[R2-acl-ipv4-basic-2000]rule pe
[R2-acl-ipv4-basic-2000]rule permit
[R2-acl-ipv4-basic-2000]qu
[R2]ospf
[R2-ospf-1]fi
[R2-ospf-1]filter-policy 2000 im
[R2-ospf-1]filter-policy 2000 import
[R2-ospf-1]qu
配置前
配置后