(2)设置静态路由后:
从PC1到PC3(连通,PC1和PC3之间已设置静态路由,使之能相互通信)
实验8 单区域OSPF路由协议配置
一、实验目的:掌握OSPF动态路由协议的配置、诊断方法 二、实验环境:Cisco Packet Tracer软件 三、网络拓扑:如下图所示
四、配置文件:
(1)路由器Router1配置文件:
R1#show run
Building configuration...
Current configuration : 593 bytes version 12.2
no service timestamps log datetime msec no service timestamps debug datetime msec
no service password-encryption hostname R1
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0 duplex auto speed auto
interface Serial0/0
ip address 192.168.12.1 255.255.255.0 clock rate 64000 interface Serial0/1 no ip address shutdown router ospf 1
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0 network 192.168.12.0 0.0.0.255 area 0 ip classless no cdp run line con 0 line vty 0 4 login end
(2)路由器Router2配置文件:
R2#show run
Building configuration...
Current configuration : 595 bytes
version 12.2
no service timestamps log datetime msec no service timestamps debug datetime msec
no service password-encryption hostname R2
interface FastEthernet0/0 no ip address duplex auto speed auto shutdown
interface Serial0/0
ip address 192.168.23.2 255.255.255.0 clock rate 64000 interface Serial0/1 (3)路由器Router3配置文件:
R3#show run
Building configuration...
Current configuration : 575 bytes version 12.2
no service timestamps log datetime msec no service timestamps debug datetime msec
no service password-encryption hostname R3
interface FastEthernet0/0
ip address 192.168.3.3 255.255.255.0 duplex auto speed auto
interface Serial0/0
五、路由表
(1)路由器Router1:
R1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user
ip address 192.168.12.2 255.255.255.0 router ospf 1
log-adjacency-changes
network 192.168.12.0 0.0.0.255 area 0 network 192.168.23.0 0.0.0.255 area 0 ip classless no cdp run line con 0 line vty 0 4 login end
no ip address shutdown
interface Serial0/1
ip address 192.168.23.3 255.255.255.0 router ospf 1
log-adjacency-changes
network 192.168.3.0 0.0.0.255 area 0 network 192.168.23.0 0.0.0.255 area 0 ip classless no cdp run line con 0 line vty 0 4 login end
static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, FastEthernet0/0
O 192.168.3.0/24 [110/129] via 192.168.12.2, 00:11:08, Serial0/0
C 192.168.12.0/24 is directly connected, Serial0/0
O 192.168.23.0/24 [110/128] via
192.168.12.2, 00:11:18, Serial0/0
(2)路由器Router2:
R2#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
O 192.168.1.0/24 [110/65] via 192.168.12.1, 00:02:57, Serial0/1 O 192.168.3.0/24 [110/65] via 192.168.23.3, 00:02:57, Serial0/0
C 192.168.12.0/24 is directly connected, Serial0/1
C 192.168.23.0/24 is directly connected, Serial0/0
(3)路由器Router3:
R3#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
N1 - OSPF NSSA external type 1, N2 -
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter are
OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP O 192.168.1.0/24 [110/129] via 192.168.23.2, 00:03:32, Serial0/1
C 192.168.3.0/24 is directly connected, FastEthernet0/0
O 192.168.12.0/24 [110/128] via 192.168.23.2, 00:03:32, Serial0/1
C 192.168.23.0/24 is directly connected, Serial0/1
六、工作站PC间的连通性 (1)设置OSPF动态路由前:
从PC1到PC3(不通,PC1和PC3间无路由可达,需要在各路由器上设置OSPF动态路由)
相关推荐: