OSPF
OSPF 协议概述 链路状态信息 RTA RTC RTD RTB 链路状态数据库 每台路由器会将当前正确的链路状态信息向一定 的范围内的所有主机发送 它支持区域的概念,同一区域内的路由器最终都 可以拥有对此区域相同的拓扑描述 每台路由器接收到此信息之后,根据最短路径算 法计算最优的下一跳 1=2=3=4
OSPF 协议计算路由过程 LSDB RTA 的 LSA RTB 的 LSA RTD 的 LSA RTC 的 LSA A D C B D C B D C B A D C B A D C B A A ( 一 ) 网络的拓扑 结构 ( 二 ) 每台路由器的链路 状态数据库 ( 三 ) 由链路状态数据库 得到的带权有向图 ( 四 ) 每台路由器分别以自己为根节点计算最小生成树 A B C D
Backbone Area VLAN 20 : OSPF 实验 PC#1 : Switch 2 0/1/1 Switch 1 PC#2 : VLAN 10 : VLAN 10 :
Switch 1 vlan 10 –switchport interface ethernet 0/0/15-20 vlan 20 –switchport interface ethernet 0/0/1 interface vlan 10 –ip address interface vlan 20 –ip address router ospf –network area 0 –redistribute connectted
Switch 2 vlan 10 –switchport interface ethernet 0/0/15-20 vlan 20 –switchport interface ethernet 0/0/1 interface vlan 10 –ip address interface vlan 20 –ip address router ospf –network area 0 –redistribute connectted
OSPF ( Backbone ) 使用 show 命令查看: –show ip route –show ip ospf –show ip ospf database –show ip ospf interface –show ip ospf neighbor –show ip ospf routing –show ip protocols
Backbone Area VLAN 20 : OSPF 实验 PC#1 : Switch 2 0/1/1 0/1/2 0/1/1 Switch 1 Switch 3 PC#3 : PC#2 : VLAN 10 : VLAN 10 : VLAN 10 :
Switch 1 vlan 10 –switchport interface ethernet 0/0/15-20 vlan 20 –switchport interface ethernet 0/0/1 interface vlan 10 –ip address interface vlan 20 –ip address router ospf –network area 0 –redistribute connectted
Switch 2 vlan 10 –switchport interface ethernet 0/0/15-20 vlan 20 –switchport interface ethernet 0/0/1-2 interface vlan 10 –ip address interface vlan 20 –ip address router ospf –network area 0 –redistribute connectted
Switch 3 vlan 10 –switchport interface ethernet 0/0/15-20 vlan 20 –switchport interface ethernet 0/0/1 interface vlan 10 –ip address interface vlan 20 –ip address router ospf –network area 0 –redistribute connectted
OSPF ( Backbone ) 使用 show 命令查看: –show ip route –show ip ospf –show ip ospf database –show ip ospf interface –show ip ospf neighbor –show ip ospf routing –show ip protocols
OSPF 实验 PC#1 : Switch 2 0/0/1 Switch 1 route 1 PC#3 : PC#2 : VLAN 10 : VLAN 10 : VLAN 10 : /0/1 0/0/2 OSPF : VLAN OSPF : VLAN
Switch 1 vlan 10 –switchport interface ethernet 0/0/15-20 vlan 20 –switchport interface ethernet 0/0/1 interface vlan 10 –ip address interface vlan 20 –ip address ospf –network area 0 –redistribute connectted
Switch 2 vlan 10 –switchport interface ethernet 0/0/15-20 vlan 20 –switchport interface ethernet 0/0/1 vlan 30 –switchport interface ethernet 0/0/2 interface vlan 10 –ip address interface vlan 20 –ip address interface vlan 30 –ip address router ospf –network area 0 –network area 0 –redistribute connectted
Switch 3 vlan 10 –switchport interface ethernet 0/0/15-20 vlan 30 –switchport interface ethernet 0/0/1 interface vlan 10 –ip address interface vlan 30 –ip address router ospf –network area 0 –Redistribute connectted
使用 show 命令查看 show ip route show ip ospf show ip ospf database show ip ospf interface show ip ospf neighbor show ip ospf routing show ip protocols