CCNA OSPF 实验

实验拓扑

R1(config)#int lo 0

R1(config-if)#ip add 1.1.1.1 255.255.255.255

R1(config-if)#ex

R1(config)#int f0/0

R1(config-if)#ip add 192.168.12.1 255.255.255.0

R1(config-if)#no sh

R1(config-if)#

*Mar 1 00:15:25.539: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up

*Mar 1 00:15:26.539: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R1(config-if)#do sh ip int b

Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 192.168.12.1 YES manual up up

Loopback0 1.1.1.1 YES manual up up

R1(config-if)#

R2#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R2(config)#int lo 0

R2(config-if)#ip add 2.2.2.2 255.255.255.255

R2(config-if)#int f0/0

R2(config-if)#ip add 192.168.12.2 255.255.255.0

R2(config-if)#no sh

R2(config-if)#

*Mar 1 00:17:28.315: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up

*Mar 1 00:17:29.315: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R2(config-if)#int f1/0

R2(config-if)#ip add 192.168.23.1 255.255.255.0

R2(config-if)#no sh

R2(config-if)#

*Mar 1 00:17:53.699: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up

*Mar 1 00:17:54.699: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up

R2(config-if)#do sh ip int b

Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 192.168.12.2 YES manual up up

FastEthernet1/0 192.168.23.1 YES manual up up

Loopback0 2.2.2.2 YES manual up up

R2(config-if)#

R3#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R3(config)#int lo 0

R3(config-if)#ip add 3.3.3.3 255.255.255.255

R3(config-if)#int f1/0

R3(config-if)#ip add 192.168.23.2 255.255.255.0

R3(config-if)#no sh

R3(config-if)#do sh p

*Mar 1 00:19:51.587: %LINK-3-UPDOWN: Interface FastEthernet1/0, changed state to up

*Mar 1 00:19:52.587: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up

R3(config-if)#do sh ip int b

Interface IP-Address OK? Method Status Protocol

FastEthernet1/0 192.168.23.2 YES manual up up

Loopback0 3.3.3.3 YES manual up up

R3(config-if)#

从R2上验证和R1 R3的连通性

R2#ping 192.168.12.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 20/32/56 ms

R2#ping 192.168.23.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.23.2, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 20/32/44 ms

R2#

但是lo 口是不通的

R1#ping 3.3.3.3 sour

R1#ping 3.3.3.3 source lo 0

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

Packet sent with a source address of 1.1.1.1

.....

Success rate is 0 percent (0/5)

开始配置路由协议

R1#

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#router ospf 100

R1(config-router)#router-id 1.1.1.1

R1(config-router)#network 1.1.1.1 0.0.0.0 area 0

R1(config-router)#network 192.168.12.1 0.0.0.0 area 0

R1(config-router)#end

R1#

*Mar 1 01:01:21.491: %SYS-5-CONFIG_I: Configured from console by console

R2#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R2(config)#router ospf 100

R2(config-router)#router-id 2.2.2.2

R2(config-router)#network 192.168.12.2 0.0.0.0 area 0

R2(config-router)#network 2.2.2.2 0.0.0.0 a 0

R2(config-router)#network 192.168.23.1 0.0.0.0 a 1

R3(config)#router ospf 100

R3(config-router)#router-id 3.3.3.3

R3(config-router)#network 192.168.23.2 0.0.0.0 a 1

R3(config-router)#network

*Mar 1 01:07:21.891: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.2.2 on FastEthernet1/0 from LOADING to FULL, Loading Done

R3(config-router)#network 3.3.3.3 0.0.0.0 a 1

已经可以看到进程为100的 邻居为2.2.2.2 状态已经起来了

看下R1

R1#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

2.2.2.2 1 FULL/BDR 00:00:37 192.168.12.2 FastEthernet0/0

R1#

邻居关系已经建立,状态是2.2.2.2是BDR备用选举路由器

在R2上看,R1是主选举主

R2#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

1.1.1.1 1 FULL/DR 00:00:37 192.168.12.1 FastEthernet0/0

3.3.3.3 1 FULL/BDR 00:00:37 192.168.23.2 FastEthernet1/0

R2#

从R1测试到R3的

R1#ping 192.168.23.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.23.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 24/34/44 ms

R1#ping 3.3.3.3 source loopback 0

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

Packet sent with a source address of 1.1.1.1

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 40/49/68 ms

R1#

都好了

从R2上看,R3是BDR,把直连R3的接口权限提高下,然后清空ospf 进程

R2(config)#int f1/0

R2(config-if)#ip ospf priority 2

R2(config)#end

R2#clear ip ospf process

Reset ALL OSPF processes? [no]: yes

R2#

*Mar 1 12:33:51.728: %OSPF-5-ADJCHG: Process 100, Nbr 1.1.1.1 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached

*Mar 1 12:33:51.764: %OSPF-5-ADJCHG: Process 100, Nbr 3.3.3.3 on FastEthernet1/0 from FULL to DOWN, Neighbor Down: Interface down or detached

R2#

*Mar 1 12:34:00.112: %OSPF-5-ADJCHG: Process 100, Nbr 1.1.1.1 on FastEthernet0/0 from LOADING to FULL, Loading Done

*Mar 1 12:34:00.836: %OSPF-5-ADJCHG: Process 100, Nbr 3.3.3.3 on FastEthernet1/0 from LOADING to FULL, Loading Done

R3已经是area 1的主选举路由了

配置IPV6的接口地址

R1(config)#ipv6 unicast-routing

R1(config)#int f0/0

R1(config-if)#ipv6 address 2001:12:12::1/64

R1(config-if)#

R2(config)#ipv6 unicast-routing

R2(config)#int f0/0

R2(config-if)#ipv6 address 2001:12:12::2/64

R2(config-if)#no sh

R2(config-if)#do ping 2001:12:12::1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:12:12::1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 20/27/44 ms

R2(config)#int f1/0

R2(config-if)#ipv6 address 2001:23:23::1/64

R2(config-if)#no sh

R3(config)#ipv6 unicast-routing

R3(config)#int f1/0

R3(config-if)#ipv6 ad

R3(config-if)#ipv6 address 2001:23:23::2/64

R3(config-if)#no sh

R3(config-if)#do ping 2001:23:23::1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:23:23::1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 20/27/44 ms

R3(config-if)#

精确宣告IPV6 路由地址

R1(config)#ipv6 router ospf 200

R1(config-rtr)#router-id 1.1.1.1

R1(config-rtr)#int f0/0

R1(config-if)#ipv6 ospf 200 area 0

唯一的区别是IPV6是在接口配置IPV4是在路由接口配置的

R2(config)#ipv6 router ospf 200

R2(config-rtr)#rou

R2(config-rtr)#router-id 2.2.2.2

R2(config-rtr)#int f0/0

R2(config-if)#ipv6 os

R2(config-if)#ipv6 ospf ?

R2(config-if)#ipv6 ospf 200 area 0

R2(config)#int f1/0

R2(config-if)#ipv6 ospf 200 area 1

R3(config)#ipv6 router ospf 200

R3(config-rtr)#router-id 3.3.3.3

R3(config-rtr)#int f1/0

R3(config-if)#ipv6 ospf 200 area 1

R3(config-if)#e

R3#sh run int f1/0

Building configuration...

Current configuration : 150 bytes

!

interface FastEthernet1/0

ip address 192.168.23.2 255.255.255.0

duplex auto

speed auto

ipv6 address 2001:23:23::2/64

ipv6 ospf 200 area 1

end

在各路由上看IPV6的邻居

R1#sh ipv6 ospf neighbor

Neighbor ID Pri State Dead Time Interface ID Interface

2.2.2.2 1 FULL/BDR 00:00:32 3 FastEthernet0/0

R1#

R2#sh ipv6 ospf neighbor

Neighbor ID Pri State Dead Time Interface ID Interface

1.1.1.1 1 FULL/DR 00:00:38 3 FastEthernet0/0

3.3.3.3 1 FULL/BDR 00:00:31 3 FastEthernet1/0

R2#

R3#sh ipv6 ospf neighbor

Neighbor ID Pri State Dead Time Interface ID Interface

2.2.2.2 1 FULL/DR 00:00:39 4 FastEthernet1/0

从R1 R3互通验证

R1#ping 2001:23:23::2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:23:23::2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 40/41/48 ms

R1#

R3#ping 2001:12:12::1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:12:12::1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 40/44/48 ms

R3#

原文地址:http://blog.51cto.com/433266/2113175

时间: 2024-08-27 10:41:09

CCNA OSPF 实验的相关文章

03-三层交换机的OSPF实验

三层交换机的OSPF实验 1.OSPF介绍 开放式最短路径优先(英语:Open Shortest Path First,缩写为 OSPF)是对链路状态路由协议的一种实现,隶属内部网关协议(IGP),故运作于自治系统内部.采用戴克斯特拉算法(Dijkstra's algorithm)被用来计算最短路径树.它使用“代价(Cost)”作为路由度量.链路状态数据库(LSDB)用来保存当前网络拓扑结构,路由器上属于同一区域的链路状态数据库是相同的(属于多个区域的路由器会为每个区域维护一份链路状态数据库).

华三OSPF实验

华三模拟器是我在一年之前安装的,至于遇到的问题已经记不清了.下面是我的OSPF实验拓扑R3路由器ospf配置命令先给点ospf进程号和router-id(如果不指定取回环地址,没有回环地址取最大IP)再进入区域进行network发布,与思科体系较有不同.R2路由器OSPF邻居R1路由器ospf路由表PC1测通PC3 原文地址:https://blog.51cto.com/14194704/2357396

OSPF实验

一:实验目的 看OSPF的DR,BDR选举时,区域中已经有一个DR,这时加入一台route ID更高的路由器,会不会进行重新选举, 或者加入一台已经开启OSPF,而且是DR的路由器,是重新选举还是同时出现两个DR. 二:实验拓扑 三.实验步骤 1.先将RT1的OSPF启动,查看G0/0 接口的角色 2.将RT2连接到SW1,再启动RT2的OSPF,查看该网段谁是DR 四.实验内容 RT1 <H3C>system-view [H3C]sysname ZJRT1 [ZJRT1]interface 

单区域 OSPF &nbsp; 实验 1:点到点链路上的 OSPF

实验目的通过本实验可以掌握:(1)在路由器上启动 OSPF 路由进程(2)启用参与路由协议的接口,并且通告网络及所在的区域(3)度量值 cost 的计算(4)hello 相关参数的配置(5)点到点链路上的 OSPF 的特征(6)查看和调试 OSPF 路由协议相关信息 实验拓扑本实验的拓扑结构如图 6-1 所示. 实验步骤 4.实验调试

CCNA OSPF同区域间的配置与运用(陈龙川)

使用OSPF的意义 OSPF是一种链路状态协议.一般链路状态协议都需要向整个网络告知邻居信息,使各节点只需要维护网络的"拓扑图",而不必交换各自连接目的站点的的距离,路由器根据拓扑生成各自的路由表.OSPF基于接口的通信量.通畅状况.往返用时.可靠性等得出路由的成本,来达到平衡网络负荷的要求.OSPF按照路由器储存的网络信息,通过SPF最短路径算法,得出最佳路由并保持连接,而不必定期地大量交换信息.OSPF的出现克服了原本RIP存在的不足,它通过组播方式完成对网络拓扑的迅速汇聚,在快速

H3C OSPF实验大集合(IPv4)

  实验目录: 1.OSPF多区域基本配置 2.OSPF创建虚链路 3.OSPF引入外部路由 4.OPPF中的stub区域 5.OSPF中的stub no-summary区域 6.OSPF中的NSSA区域     一.OSPF多区域基本配置 按照上面的拓扑配置ip地址   宣告网络 R1上的lo0和s0/2/0宣告到区域1中. [R1]ospf [R1-ospf-1]area 1 [R1-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255 [R1-

H3C OSPF实验大集合(IPv6)

  实验目录: 1.OSPFv3多区域基本配置 2.OSPFv3创建虚链路 3.OSPFv3引入外部路由 4.OSPFv3中的stub区域 5.OSPFv3中的stub no-summary区域       一.OSPF多区域基本配置IPv6   配置ipv6地址 [R1]ipv6 [R1]int lo0 [R1-LoopBack0]ipv6 add 1::1/128 [R1-LoopBack0]int s0/2/0 [R1-Serial0/2/0]ipv6 add 2001::1/64 [R1

ospf实验二

1 R1,R2,R3为17.1.1.0网段 1. R4先做rip #rip 1 #version 2 #undo sum.. #netwokr 14.0.0.0 在R4上做rip和ospf注入 #ospf 1 #import rip type 1 #rip 1 #import-route ospf 2. 帧中继的配置 在R1做:(R2和R3同R1) #int s3/0/0 #link-protocol  fr #fr map ip 17.1.1.1 102 #fr map ip 17.1.1.3

OSPF实验1

实验拓扑 R1配置: [V200R003C00] # sysname R1 # snmp-agent local-engineid 800007DB03000000000000 snmp-agent # clock timezone China-Standard-Time minus 08:00:00 # portal local-server load flash:/portalpage.zip # drop illegal-mac alarm # wlan ac-global carrier