ospf. ospf 协议概述 链路状态信息 rta rtc rtd rtb 1 2 3 4 链路状态数据库...
TRANSCRIPT
OSPF
OSPF协议概述
链路状态信息链路状态信息
链路状态信息 链路状态信息
RTARTC
RTDRTB
1 23
4
链路状态数据库
• 每台路由器会将当前正确的链路状态信息向一定的范围内的所有主机发送
• 它支持区域的概念,同一区域内的路由器最终都可以拥有对此区域相同的拓扑描述
• 每台路由器接收到此信息之后,根据最短路径算法计算最优的下一跳
• 1=2=3=4
OSPF协议计算路由过程LSDB
RTA的 LSA
RTB的 LSA
RTD的 LSA
RTC的 LSA
1
2 5
3
A
D
C
B1
2 5
3
D
C
B1
2
3
D
C
B1
2
3
A
D
C
B1
2
3
A
D
C
B1
2
3
AA
(一 )网络的拓扑结构
(二 )每台路由器的链路状态数据库
(三 )由链路状态数据库得到的带权有向图
(四 )每台路由器分别以自己为根节点计算最小生成树
A B
C
D
Backbone Area 0.0.0.0
VLAN 20: 192.168.4.1-2
OSPF实验
PC#1: 192.168.1.100
Switch 2
0/1/1
0/1/1
Switch 1
PC#2: 192.168.2.100
VLAN 10: 192.168.1.1
VLAN 10: 192.168.2.1
Switch 1• vlan 10
– switchport interface ethernet 0/0/15-20• vlan 20
– switchport interface ethernet 0/0/1• interface vlan 10
– ip address 192.168.1.1 255.255.255.0• interface vlan 20
– ip address 192.168.10.1 255.255.255.0• router ospf
– network 192.168.10.0 255.255.255.0 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 192.168.2.1 255.255.255.0• interface vlan 20
– ip address 192.168.10.2 255.255.255.0• router ospf
– network 192.168.10.0 255.255.255.0 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 0.0.0.0
VLAN 20: 192.168.4.1-3
OSPF实验
PC#1: 192.168.1.100
Switch 2
0/1/1 0/1/2
0/1/1 0/1/1
Switch 1 Switch 3
PC#3: 192.168.3.100
PC#2: 192.168.2.100
VLAN 10: 192.168.1.1 VLAN 10: 192.168.3.1
VLAN 10: 192.168.2.1
Switch 1
• vlan 10– switchport interface ethernet 0/0/15-20
• vlan 20– switchport interface ethernet 0/0/1
• interface vlan 10– ip address 192.168.1.1 255.255.255.0
• interface vlan 20– ip address 192.168.10.1 255.255.255.0
• router ospf– network 192.168.10.0 255.255.255.0 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 192.168.2.1 255.255.255.0
• interface vlan 20– ip address 192.168.10.2 255.255.255.0
• router ospf– network 192.168.10.0 255.255.255.0 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 192.168.3.1 255.255.255.0
• interface vlan 20– ip address 192.168.10.3 255.255.255.0
• router ospf– network 192.168.10.0 255.255.255.0 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: 192.168.1.100
Switch 2
0/0/1
Switch 1 route 1
PC#3: 192.168.3.100
PC#2: 192.168.2.100
VLAN 10: 192.168.1.1 VLAN 10: 192.168.3.1
VLAN 10: 192.168.2.1
0/0/1
0/0/1 0/0/2OSPF: VLAN 30
192.168.30.1-3OSPF: VLAN 20
192.168.10.1-3
Switch 1
• vlan 10– switchport interface ethernet 0/0/15-20
• vlan 20– switchport interface ethernet 0/0/1
• interface vlan 10– ip address 192.168.1.1 255.255.255.0
• interface vlan 20– ip address 192.168.10.1 255.255.255.0
• ospf– network 192.168.10.0 255.255.255.0 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 192.168.2.1 255.255.255.0• interface vlan 20
– ip address 192.168.10.2 255.255.255.0• interface vlan 30
– ip address 192.168.30.1 255.255.255.0• router ospf
– network 192.168.10.0 255.255.255.0 area 0– network 192.168.30.0 255.255.255.0 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 192.168.3.1 255.255.255.0
• interface vlan 30– ip address 192.168.30.2 255.255.255.0
• router ospf– network 192.168.30.0 255.255.255.0 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