单区域OSPF路由协议的配置


1.拓扑图


2.各路由器上配置完成后的 show run
  a.r1#show run 
Building configuration...

Current configuration : 645 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname r1
!
!
  www.zhishiwu.com  
interface Loopback0
 ip address 11.11.1.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 172.16.123.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 10.10.1.254 255.255.255.0
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 100
 log-adjacency-changes
 network 172.16.123.1 0.0.0.0 area 0
 network 10.10.1.254 0.0.0.0 area 0
!
ip classless
!
!
line con 0
line vty 0 4
 login
!
!
end入内容  b.r2#
r2#show run
Building configuration...

Current configuration : 666 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname r2
!
!
interface Loopback0
 ip address 22.22.2.2 255.255.255.0
!
interface FastEthernet0/0
 ip address 172.16.123.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 10.10.2.254 255.255.255.0
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 100
 router-id 22.22.2.2
 log-adjacency-changes
 network 172.16.123.2 0.0.0.0 area 0
 network 10.10.2.254 0.0.0.0 area 0
!
ip classless
!
!
line con 0
line vty 0 4
 login
!
!
end  c.
  www.zhishiwu.com  r3#
r3#show run
Building configuration...

Current configuration : 645 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname r3
!
!
interface Loopback0
 ip address 33.33.3.3 255.255.255.0
!
interface FastEthernet0/0
 ip address 172.16.123.3 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 10.10.3.254 255.255.255.0
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 100
 log-adjacency-changes
 network 172.16.123.3 0.0.0.0 area 0
 network 10.10.3.254 0.0.0.0 area 0
!
ip classless
!
!
line con 0
line vty 0 4
 login
!
!
end
3.查看邻居表、拓扑表、路由表
  a.r1#show ip ospf nei

Neighbor ID Pri   State   Dead Time   Address Interface
22.22.2.2 1   FULL/BDR 00:00:35 172.16.123.2 FastEthernet0/0
33.33.3.3 1   FULL/DROTHER 00:00:31 172.16.123.3 FastEthernet0/0
r1#show ip ospf nei

Neighbor ID Pri   State   Dead Time   Address Interface
22.22.2.2 1   FULL/BDR 00:00:30 172.16.123.2 FastEthernet0/0
33.33.3.3 1   FULL/DROTHER 00:00:36 172.16.123.3 FastEthernet0/0
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 static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

 10.0.0.0/24 is subnetted, 3 subnets
C   10.10.1.0 is directly connected, FastEthernet0/1
O   10.10.2.0 [110/2] via 172.16.123.2, 00:06:07, FastEthernet0/0
O   10.10.3.0 [110/2] via 172.16.123.3, 00:05:57, FastEthernet0/0
 11.0.0.0/24 is subnetted, 1 subnets
C   11.11.1.0 is directly connected, Loopback0
 172.16.0.0/24 is subnetted, 1 subnets
C   172.16.123.0 is directly connected, FastEthernet0/0
r1#b.r2#show ip ospf nei

Neighbor ID Pri   State   Dead Time   Address Interface
11.11.1.1 1   FULL/DR 00:00:38 172.16.123.1 FastEthernet0/0
33.33.3.3 1   FULL/DROTHER 00:00:31 172.16.123.3 FastEthernet0/0
r2#show ip ospf data
OSPF Router with ID (22.22.2.2) (Process ID 100)

Router Link States (Area 0)

Link ID ADV Router  Age Seq#   Checksum Link count
172.16.123.1 172.16.123.1 2475 0x80000003 0x0055f2 2
172.16.123.2 172.16.123.2 1926 0x80000005 0x006ed2 2
172.16.123.3 172.16.123.3 1651 0x80000007 0x0087b2 2
22.22.2.2   22.22.2.2   489 0x80000007 0x0063f0 2
11.11.1.1   11.11.1.1   489 0x80000007 0x003254 2
33.33.3.3   33.33.3.3   469 0x80000003 0x009c89 2

Net Link States (Area 0)
Link ID ADV Router  Age Seq#   Checksum
172.16.123.1 11.11.1.1   469 0x80000004 0x00fd41
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

 10.0.0.0/24 is subnetted, 3 subnets
O   10.10.1.0 [110/2] via 172.16.123.1, 00:07:57, FastEthernet0/0
C   10.10.2.0 is directly connected, FastEthernet0/1
O   10.10.3.0 [110/2] via 172.16.123.3, 00:07:47, FastEthernet0/0
 22.0.0.0/24 is subnetted, 1 subnets
C   22.22.2.0 is directly connected, Loopback0
 172.16.0.0/24 is subnetted, 1 subnets
C   172.16.123.0 is directly connected, FastEthernet0/0
r2#c.r3#show ip ospf nei

Neighbor ID Pri   State   Dead Time   Address Interface
22.22.2.2 1   FULL/BDR 00:00:33 172.16.123.2 FastEthernet0/0
11.11.1.1 1   FULL/DR 00:00:37 172.16.123.1 FastEthernet0/0
r3#show ip ospf data
OSPF Router with ID (33.33.3.3) (Process ID 100)

Router Link States (Area 0)

Link ID ADV Router  Age Seq#   Checksum Link count
172.16.123.1 172.16.123.1 2546 0x80000003 0x0055f2 2
172.16.123.2 172.16.123.2 1997 0x80000005 0x006ed2 2
172.16.123.3 172.16.123.3 1722 0x80000007 0x0087b2 2
22.22.2.2   22.22.2.2   560 0x80000007 0x0063f0 2
11.11.1.1   11.11.1.1   560 0x80000007 0x003254 2
33.33.3.3   33.33.3.3   540 0x80000003 0x009c89 2

Net Link States (Area 0)
Link ID ADV Router  Age Seq#   Checksum
172.16.123.1 11.11.1.1   540 0x80000004 0x00fd41
r3#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
  www.zhishiwu.com  
Gateway of last resort is not set

 10.0.0.0/24 is subnetted, 3 subnets
O   10.10.1.0 [110/2] via 172.16.123.1, 00:08:59, FastEthernet0/0
O   10.10.2.0 [110/2] via 172.16.123.2, 00:08:59, FastEthernet0/0
C   10.10.3.0 is directly connected, FastEthernet0/1
 33.0.0.0/24 is subnetted, 1 subnets
C   33.33.3.0 is directly connected, Loopback0
 172.16.0.0/24 is subnetted, 1 subnets
C   172.16.123.0 is directly connected, FastEthernet0/0
r3#
备注:在Packet Tracer环境中,如开始没有配置router-id,之后才配置loopback 0 IP地址,loopback地址不会自动成为router-id,而需要保存配置后,用reload命令重启路由器。

推荐阅读

    学习写字楼新选择6000元主流配置

    学习写字楼新选择6000元主流配置,,这种配置需要考虑双核心的办公和娱乐平台,充分考虑办公室的办公需求和娱乐需求,以约6000元的预算和cost-e

    酷睿I7 配置

    酷睿I7 配置,配置,玩家国度啦华硕 Rampage II Extreme(3800元)如果米不够,也可以把Extreme改为Gene,不过是小板内存推荐金士顿6G DDR3 2000骇

    提高3A四核羿龙II游戏配置的性能

    提高3A四核羿龙II游戏配置的性能,,以节能环保为主题的IT产业,目前3A低端平台处理器、主板芯片组、独立开发卡性能突出,特别是在与AMD的处理

    opporeno8参数配置及价格

    opporeno8参数配置及价格,面部,亿元,Oppo的荣誉2020年1月4日,接近屏幕关闭传感器是否支持双卡:支持oppor11splus什么时候上市的Oppo R11S P

    查看配置:酷睿i3530集展示办公平台

    查看配置:酷睿i3530集展示办公平台,,由于时间和精力的关系,我们不可能对所有的配置进行评论,希望我们能理解,我希望我们的评论能在那些需要帮

    3500元超额值学生娱乐结构的优化配置

    3500元超额值学生娱乐结构的优化配置,,作为一个DIY的主流用户领域的学生,每个用户51学生攒机的高峰。因为学生用户没有稳定的收入来源,攒机

    最新的AMD低端APUa46300盒装处理器上市

    最新的AMD低端APUa46300盒装处理器上市,,APU处理器,AMD的APU系列我们并不陌生,是目前流行的AMD主要处理器,一直很受用户的欢迎,在a10-5800k发