OSPF实验

OSPF实验_第1张图片

R1对各个接口和环回进行IP的配置

[r1]int LoopBack 0
[r1-LoopBack0]
[r1-LoopBack0]ip add 172.16.34.1 24
[r1-LoopBack0]q
[r1]int GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]
[r1-GigabitEthernet0/0/0]
[r1-GigabitEthernet0/0/0]ip add 172.16.33.9 29
然后对每个路由器写缺省路由:
[r1]ip route-static 0.0.0.0 0 172.16.33.10

对中心站点R3进行配置

[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 172.16.0.1 29  
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 34.0.0.1
Oct  1 2022 21:55:33-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry multicast dynamic 
[r3-Tunnel0/0/0]

 对R5进行配置

[r5]int Tunnel 0/0/0
[r5-Tunnel0/0/0]ip add 172.16.0.2 29    
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r5-Tunnel0/0/0]source Serial 4/0/0
Oct  1 2022 21:59:49-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 172.16.0.1 34.0.0.1 register

对R6进行配置

[r6]interface Tunnel 0/0/0
[r6-Tunnel0/0/0]ip add 172.16.0.3 29
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r6-Tunnel0/0/0]source Serial 4/0/0
Oct  1 2022 22:03:13-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r6-Tunnel0/0/0]nhrp network-id 100    
[r6-Tunnel0/0/0]nhrp entry 172.16.0.1 34.0.0.1 register

对R7进行配置

[r7]int Tunnel 0/0/0
[r7-Tunnel0/0/0]ip add 172.16.0.4 29
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r7-Tunnel0/0/0]source GigabitEthernet 0/0/0
Oct  1 2022 22:07:22-08:00 r7 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r7-Tunnel0/0/0]nhrp network-id 100    
[r7-Tunnel0/0/0]nhrp entry 172.16.0.1 34.0.0.1 register 

OSPF实验_第2张图片

 ospf设置
[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.0.0 0.0.255.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.0.0 0.0.255.255


[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]net 172.16.0.1 0.0.0.0
[r3-ospf-1-area-0.0.0.0]q
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]    
[r3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.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.0.0 0.0.255.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.0.0 0.0.3.255
[r6-ospf-1-area-0.0.0.0]q
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]network 172.16.65.9 0.0.0.0


[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.0.0 0.0.3.255
[r7-ospf-1-area-0.0.0.0]q
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]network 172.16.97.9 0.0.0.0


[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.0.0 0.0.255.255


[r9]ospf 1 router-id 9.9.9.9
[r9-ospf-1]area 3
[r9-ospf-1-area-0.0.0.3]network 172.16.97.18 0.0.0.0
[r9-ospf-1]area 4
[r9-ospf-1-area-0.0.0.4]network 172.16.128.0 0.0.3.255


[r10]ospf 1 router-id 10.10.10.10
[r10-ospf-1]area 4    
[r10-ospf-1-area-0.0.0.4]network 172.16.0.0 0.0.255.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.0.0 0.0.255.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.65.18 0.0.0.0
[r12]rip 1
[r12-rip-1]v 2
[r12-rip-1]network 172.16.0.0

AREA4改域外路由


[r9]ospf 1
[r9-ospf-1]area 4                         
[r9-ospf-1-area-0.0.0.4]undo net 172.16.128.0 0.0.3.255
[r9-ospf-1-area-0.0.0.4]q
[r9-ospf-1]undo area 4
[r9-ospf-1]q    
[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.3.255
r10也一样
[r10]ospf 1
[r10-ospf-1]area 4    
[r10-ospf-1-area-0.0.0.4]undo network 172.16.0.0 0.0.255.255
[r10-ospf-1-area-0.0.0.4]q
[r10-ospf-1]undo a 4
[r10-ospf-1]
[r10-ospf-1]q
[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.0.0 0.0.255.255

[r9]ospf 1
[r9-ospf-1]import-route ospf 2
[r9-ospf-1]
[r9-ospf-1]q
[r9]ospf 2
[r9-ospf-2]default-route-advertise

[r10]ip route-static 0.0.0.0 0 172.16.129.9

路由汇总
[r3]ospf 1    
[r3-ospf-1]area 1    
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
[r12]ospf 1
[r12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
[r9]ospf 1    
[r9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0

AR1
[r1]ospf 1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]stub 
 
AR2
[r1]ospf 1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]stub 
 
AR3
[r3]ospf 1
[r3-ospf-1]a 1
[r3-ospf-1-area-0.0.0.1]stub no-summary 
 
AR6
[r6]ospf 1
[r6-ospf-1]a 2  
[r6-ospf-1-area-0.0.0.2]nssa no-summary
 
AR11
r11]ospf 1
[r11-ospf-1]a 2  
[r11-ospf-1-area-0.0.0.2]nssa 
 
AR12
[r12]ospf 1
[r12-ospf-1]a 2
[r12-ospf-1-area-0.0.0.2]nssa 
 
AR7
[r7]ospf 1
[r7-ospf-1]a 3
[r7-ospf-1-area-0.0.0.3]nssa no-summary
 
AR8
[r8]ospf 1
[r8-ospf-1]a 3
[r8-ospf-1-area-0.0.0.3]nssa 
 
AR9
[r9]ospf 1
[r9-ospf-1]a 3 
[r9-ospf-1-area-0.0.0.3]nssa

[r3]ip route-static 172.16.32.0 19 NULL 0
[r6]ip route-static 172.16.64.0 19 NULL 0
[r7]ip route-static 172.16.96.0 19 NULL 0
[r9]ip route-static 172.16.128.0 19 NULL 0
[r12]ip route-static 172.16.160.0 19 NULL 0

nat地址的转换

AR3
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r3]int s 4/0/0
[r3-Serial4/0/0]nat outbound 2000
 
AR5
[r5]acl 2000   
[r5-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r5]int s4/0/0
[r5-Serial4/0/0]nat outbound 2000
 
AR6
[r6]acl 2000
[r6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r6-acl-basic-2000]q
[r6]int Serial 4/0/0
[r6-Serial4/0/0]nat outbound 2000
 
AR7
[r7]acl 2000    
[r7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r7]int GigabitEthernet 0/0/0
[r7-GigabitEthernet0/0/0]nat outbound 2000
[r7-GigabitEthernet0/0/0]

修改hellow时间

AR3
[r3]int t0/0/0
[r3-Tunnel0/0/0]ospf timer hello 10
 
AR5
[r5]int t0/0/0
[r5-Tunnel0/0/0]ospf timer hello 10
 
AR6
[r6]int t0/0/0
[r6-Tunnel0/0/0]ospf timer  hello 10
 
AR7
[r7]int t0/0/0   
[r7-Tunnel0/0/0]ospf timer  hello  10

你可能感兴趣的:(网络,智能路由器)