ospf 动态路由协议 virtual link Cisco

1:OSPF虚链路的作用是什么?在哪些路由器上需要建立虚链路?

     1:虚链路可以将不连续的区域0连接起来

     2:还可将区域通过中转区域连接到区域0,两个路由器有共同的非骨干区域

2:OSPF协议的区域0是什么?能不能没有区域0?

     骨干区域,不可以没有

3:OSPF路由器的router-id如何查看?为了OSPF网络的稳定,应该如何指定

     Show ip ospf int

     分开指定

4:OSPF的路由表选择的路径是以带宽和延迟为依据还是以经过的路由器多少?

     带宽和延迟为依据

拓扑图:

配置代码:

R1
enable
config terminal
host r1
no ip domain-lookup
int g0/0
ip address 192.168.1.1 255.255.255.0
no shut
exit
router ospf 100 
!进程号,1-65535中任意数,且这个是路由器本地进程号,即其它路由器也可以设置一样的进程号
network 192.168.1.0 0.0.0.255 area 1
router-id 192.168.1.1  
!这个路由器有多个接口,谁代表本区域跟别的交换链路状态数据报呢?就是路由id是谁呢?指定路由id,不指定也会进行选举(优先级一样时,谁的ip地址大,就做)
end
Show ip route
Show ip ospf
!要查看某一路由器的ID,可以这样查看show ip ospf

R2
enable
config terminal
host r2
no ip domain-lookup
int g0/0
ip address 192.168.1.2 255.255.255.0
no shut
int g0/1
ip address 192.168.2.1 255.255.255.0
no shut
exit
router ospf 100
network 192.168.1.0 0.0.0.255 area 1
network 192.168.2.0 0.0.0.255 area 0
router-id 192.168.2.1
end
Show ip route
Show ip ospf

R3
enable
config terminal
host r3
no ip domain-lookup
!下面设置接口的IP参数
int g0/0
ip address 192.168.2.2 255.255.255.0
no shut
int g0/1
ip address 192.168.3.1 255.255.255.0
no shut
int loopback 0
!环回口,一般常用环回口来做router-id
ip address 3.3.3.3 255.255.255.255
no shut
exit
router ospf 100
network 192.168.2.0 0.0.0.255 area 0
network 192.168.3.0 0.0.0.255 area 2
router-id 3.3.3.3
!一般常用环回口来做router-id
area 2 virtual-link 4.4.4.4
!在建立虚链路前先显示路由表,然后建立虚链接时指定对端路由器ID
!R3(config-router)#area  2  virtual-link  4.4.4.4    //2为要穿越的区域(R4-ID) 
!一定要记住区域编号为穿越经过的区域,而不是需要连接的区域
!要查看某一路由器的ID,可以这样查看show ip ospf
end
Show ip route
Show ip ospf

R4
enable
config terminal
host r4
no ip domain-lookup
int g0/0
ip address 192.168.3.2 255.255.255.0
no shut
int g0/1
ip address 192.168.4.1 255.255.255.0
no shut
int loopback 0
ip address 4.4.4.4 255.255.255.255
no shut
exit
router ospf 100
network 192.168.3.0 0.0.0.255 area 2
network 192.168.4.0 0.0.0.255 area 3
router-id 4.4.4.4
area 2 virtual-link 3.3.3.3
!在建立虚链路前先显示路由表,然后建立虚链接时指定对端路由器ID
!R4(config-router)#area  2  virtual-link  3.3.3.3    //2为要穿越的区域(R3-ID)  
!一定要记住区域编号为穿越经过的区域,而不是需要连接的区域
!要查看某一路由器的ID,可以这样查看show ip ospf
end
Show ip route
Show ip ospf

R5
enable
config terminal
host r5
no ip domain-lookup
int g0/0
ip address 192.168.4.2 255.255.255.0
no shut
int loopback 0
ip address 5.5.5.5 255.255.255.255
no shut
exit
router ospf 100
network 192.168.4.0 0.0.0.255 area 3
router-id 5.5.5.5
end
Show ip route
Show ip ospf
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章