博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
单区域OSPF路由协议的配置
阅读量:5820 次
发布时间:2019-06-18

本文共 6738 字,大约阅读时间需要 22 分钟。

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
!
!
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.
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
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命令重启路由器。
     本文转自kindIT 51CTO博客,原文链接:http://blog.51cto.com/kindit/1019844
,如需转载请自行联系原作者
你可能感兴趣的文章
C#实现抽奖程序(2)
查看>>
Java程序测试
查看>>
Linux下vim命令详解
查看>>
我的友情链接
查看>>
VMware Workstation 克隆 CentOS虚机之后网卡配置
查看>>
你不需要看懂,大姨妈要来。
查看>>
cisco-switch
查看>>
Linux命令:useradd
查看>>
保障企业网络安全的一些措施
查看>>
asp.net 关于提示“当前上下文中不存在名称"XXX"”的一种情况的解决办法
查看>>
jQuery 关于点击菜单项,使子条目"向上"展开效果的实现
查看>>
Spring AOP
查看>>
spark mllib 朴素贝叶斯 应用案例
查看>>
mysql主从同步slave错误1062
查看>>
Microsoft.NETCore.App 版本不一致导致的运行失败
查看>>
win32控件(edit)
查看>>
Handle的原理(Looper、Handler、Message三者关系)
查看>>
dubbo学习笔记 第十章dubbo服务实现http调用
查看>>
[UMU WSH 教程](46) 按图片拍摄时间批量重命名改进版
查看>>
未将对象引用设置到对象的实例--可能出现的问题总结
查看>>