OSPF Virtual Link
by admin · Wrzesień 30, 2017
OSPF jest protokołem typu link state, czyli wszystkie routery wymieniają się między sobą trasami i każdy z nich oblicza trasy zgodnie z algorytmem Dijsktry. Każda zmiana w sieci, niesie za sobą konieczność ponownego przeliczania tras. W dużych sieciach, gdzie jest dużo routerów każdy z nich musi przeliczać trasy co wpływa na stabilność pracy sieci oraz na czas konwergencji. OSPF umożliwia podział sieci na obszary (area) dzięki czemu tylko routery w tym samym obszarze przetwarzają LSA między sobą, natomiast między obszarami są tzw routery brzegowe, ABR (Area Border Router), które umożliwiają sumaryzowanie tras dzięki czemu routery w innych obszarach nie muszą znać wszystkich tras z innego obszaru ani nie muszą brać udziału w przeliczaniu tych tras, co poprawia stabilność pracy zmniejsza obciążenie routerów oraz skraca czas konwergencji. Każdy obszar musi być połączony do obszaru szkieletowego (area 0). Czasami projekt sieci OSPF jest taki, że mamy obszary, które nie są podłączone do obszaru 0, np. tak jak to ma miejsce na poniższym diagramie:
Sieć skonfigurowana jest następująco:
R1
hostname R1
!
interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
!
router ospf 1
network 192.168.12.0 0.0.0.255 area 0
R2
hostname R2
!
interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
!
interface FastEthernet1/0
ip address 192.168.23.2 255.255.255.0
!
router ospf 1
network 192.168.12.0 0.0.0.255 area 0
network 192.168.23.0 0.0.0.255 area 10
R3
hostname R3
!
interface FastEthernet0/0
ip address 192.168.34.3 255.255.255.0
!
interface FastEthernet1/0
ip address 192.168.23.3 255.255.255.0
!
router ospf 1
network 192.168.23.0 0.0.0.255 area 10
network 192.168.34.0 0.0.0.255 area 20
R4
hostname R4
!
interface FastEthernet0/0
ip address 192.168.34.4 255.255.255.0
!
router ospf 1
network 192.168.34.0 0.0.0.255 area 20
R4#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.34.3 1 FULL/BDR 00:00:32 192.168.34.3 FastEthernet0/0
R4#show ip route
Codes: L - local, C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.34.0/24 is directly connected, FastEthernet0/0
L 192.168.34.4/32 is directly connected, FastEthernet0/0
KONFIGURACJA VIRTUAL LINK
R2(config-router)#area 10 virtual-link 192.168.34.3
R2(config-router)#
*Nov 21 13:14:37.135: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.34.3 on OSPF_VL0 from LOADING to FULL, Loading Done
R3(config-router)#area 10 virtual-link 192.168.23.2
R3(config-router)#
*Nov 21 13:14:36.419: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.2 on OSPF_VL0 from LOADING to FULL, Loading Done
R4#show ip route
Codes: L - local, C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
O IA 192.168.12.0/24 [110/3] via 192.168.34.3, 00:01:29, FastEthernet0/0
O IA 192.168.23.0/24 [110/2] via 192.168.34.3, 00:01:34, FastEthernet0/0
192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.34.0/24 is directly connected, FastEthernet0/0
L 192.168.34.4/32 is directly connected, FastEthernet0/0
R1#ping 192.168.34.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.34.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/57/64 ms
R4#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 100 percent (5/5), round-trip min/avg/max = 40/46/52 ms
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.23.2 0 FULL/ - 00:00:15 192.168.23.2 OSPF_VL0
192.168.23.2 1 FULL/BDR 00:00:35 192.168.23.2 FastEthernet1/0
192.168.34.4 1 FULL/DR 00:00:37 192.168.34.4 FastEthernet0/0
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.34.3 0 FULL/ - - 192.168.23.3 OSPF_VL0
192.168.12.1 1 FULL/BDR 00:00:31 192.168.12.1 FastEthernet0/0
192.168.34.3 1 FULL/DR 00:00:30 192.168.23.3 FastEthernet1/0
R3#show ip ospf virtual-links
Virtual Link OSPF_VL0 to router 192.168.23.2 is up
Run as demand circuit
DoNotAge LSA allowed.
Transit area 10, via interface FastEthernet1/0
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:08
Adjacency State FULL (Hello suppressed)
Index 1/3, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
R2#show ip ospf virtual-links
Virtual Link OSPF_VL0 to router 192.168.34.3 is up
Run as demand circuit
DoNotAge LSA allowed.
Transit area 10, via interface FastEthernet1/0
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:09
Adjacency State FULL (Hello suppressed)
Index 2/3, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec