Skip to content

huawei ağ ekipmanlarında basit ospf uygulaması

ospf detaylarına girmeden huawei ağ ekipmanlarında ospf nasıl kullanabiliriz ve kontrol edebiliriz aşağıdaki örnek topolojide incelemeye çalışalım.

yönlendiriciler üzerine öncelikle arayüz iplerini girelim

sysname R1

router id 192.168.0.1

interface Ethernet0/0/1
 ip address 192.168.100.1 255.255.255.0

interface GigabitEthernet0/0/0
 ip address 192.168.1.1 255.255.255.252

interface LoopBack0
 ip address 192.168.0.1 255.255.255.255
sysname R2

router id 192.168.0.2

interface Ethernet0/0/1
 ip address 192.168.101.1 255.255.255.0

interface GigabitEthernet0/0/0
 ip address 192.168.1.2 255.255.255.252

interface LoopBack0
 ip address 192.168.0.2 255.255.255.255

arayüzlerin durumunu kontrol edelim

<R1>display ip interface brief 
*down: administratively down
!down: FIB overload down
^down: standby
(l): loopback
(s): spoofing
(d): Dampening Suppressed
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 8
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 8

Interface                         IP Address/Mask      Physical   Protocol  
Ethernet0/0/0                     unassigned           down       down      
Ethernet0/0/1                     192.168.100.1/24     up         up        
GigabitEthernet0/0/0              192.168.1.1/30       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
GigabitEthernet0/0/3              unassigned           down       down      
LoopBack0                         192.168.0.1/32       up         up(s)     
NULL0                             unassigned           up         up(s)     
Serial0/0/0                       unassigned           down       down      
Serial0/0/1                       unassigned           down       down      
Serial0/0/2                       unassigned           down       down      
Serial0/0/3                       unassigned           down       down 

tüm arayüzlerimiz aktif durumda. yönlendirme tablolarını da kontrol edelim

<R1>display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 7        Routes : 7        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
    192.168.1.0/30  Direct  0    0           D   192.168.1.1     GigabitEthernet0/0/0
    192.168.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
  192.168.100.0/24  Direct  0    0           D   192.168.100.1   Ethernet0/0/1
  192.168.100.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/1

R1 üzerinde görüleceği üzere pc1 den pc2 ye ulaşmak istersek R1 üzerinden gerekli yönlendirme yapılamayacaktır. bu yönlendirme işlemini ospf ile yapmaya çalışalım..

R1 üzerine area 0 oluşturalım ve cihaz üzerindeki tüm networkleri ekleyelim

[R1]ospf 1 router-id 192.168.0.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 192.168.100.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.3
[R1-ospf-1-area-0.0.0.0]network 192.168.0.1 0.0.0.0

r1 üzerinde ospf için gerekli ayarları yaptıktan sonra gerekli kontrolleri sağlayalım.

[R1]display  ospf lsdb 

	 OSPF Process 1 with Router ID 192.168.0.1
		 Link State Database 

		         Area: 0.0.0.0
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    192.168.0.1     192.168.0.1        440  60    80000005       1
<R1>display ospf nexthop 

	 OSPF Process 1 with Router ID 192.168.0.1
		 Routing Nexthop information 

  Next hops: 
  Address         Type       Refcount  IntfAddr        Intf Name 
 ----------------------------------------------------------------
  192.168.100.1   Local      1         192.168.100.1   Ethernet0/0/1 
  192.168.1.1     Local      1         192.168.1.1     GigabitEthernet0/0/0 
  192.168.0.1     Local      1         192.168.0.1     LoopBack0 
<R1>display ospf routing 

	 OSPF Process 1 with Router ID 192.168.0.1
		  Routing Tables 

 Routing for Network 
 Destination        Cost  Type       NextHop         AdvRouter       Area
 192.168.0.1/32     0     Stub       192.168.0.1     192.168.0.1     0.0.0.0
 192.168.1.0/30     1     Stub       192.168.1.1     192.168.0.1     0.0.0.0
 192.168.100.0/24   1     Stub       192.168.100.1   192.168.0.1     0.0.0.0

 Total Nets: 3  
 Intra Area: 3  Inter Area: 0  ASE: 0  NSSA: 0 
[R1]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 7        Routes : 7        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
    192.168.1.0/30  Direct  0    0           D   192.168.1.1     GigabitEthernet0/0/0
    192.168.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
  192.168.100.0/24  Direct  0    0           D   192.168.100.1   Ethernet0/0/1
  192.168.100.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/1

şimdi R2 üzefinde ospf konfigürasyonu yapmaya başlayalım. ilk önce area 0 oluşturalım ve R1 arayünün ip networke ekleyelim ve değişimleri gözlemleyelim

<R1>display ospf lsdb

	 OSPF Process 1 with Router ID 192.168.0.1
		 Link State Database 

		         Area: 0.0.0.0
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    192.168.0.2     192.168.0.2         35  36    80000003       1
 Router    192.168.0.1     192.168.0.1         31  60    80000009       1
 Network   192.168.1.1     192.168.0.1         31  32    80000002       0
<R1>display ospf routing

	 OSPF Process 1 with Router ID 192.168.0.1
		  Routing Tables 

 Routing for Network 
 Destination        Cost  Type       NextHop         AdvRouter       Area
 192.168.0.1/32     0     Stub       192.168.0.1     192.168.0.1     0.0.0.0
 192.168.1.0/30     1     Transit    192.168.1.1     192.168.0.1     0.0.0.0
 192.168.100.0/24   1     Stub       192.168.100.1   192.168.0.1     0.0.0.0

 Total Nets: 3  
 Intra Area: 3  Inter Area: 0  ASE: 0  NSSA: 0 
<R1>display ospf nexthop 

	 OSPF Process 1 with Router ID 192.168.0.1
		 Routing Nexthop information 

  Next hops: 
  Address         Type       Refcount  IntfAddr        Intf Name 
 ----------------------------------------------------------------
  192.168.100.1   Local      1         192.168.100.1   Ethernet0/0/1 
  192.168.1.1     Local      1         192.168.1.1     GigabitEthernet0/0/0 
  192.168.0.1     Local      1         192.168.0.1     LoopBack0 
<R1>display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 7        Routes : 7        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
    192.168.1.0/30  Direct  0    0           D   192.168.1.1     GigabitEthernet0/0/0
    192.168.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
  192.168.100.0/24  Direct  0    0           D   192.168.100.1   Ethernet0/0/1
  192.168.100.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/1

R2 için diğer networkleride ekleyelim. yönlendirme tabloları , lsdb vb deki değişimleri gözlemleyelim.

ospf 1 router-id 192.168.0.2
 area 0.0.0.0
  network 192.168.1.0 0.0.0.3
  network 192.168.0.2 0.0.0.0
  network 192.168.101.0 0.0.0.255

tüm networkleri r2 üzerinde tamamladıktan sonra yönlendirme tablosunu kontrol ederek pc1 den pc2 ye erişimi kontrol edelim.

<R1>display ospf routing 

	 OSPF Process 1 with Router ID 192.168.0.1
		  Routing Tables 

 Routing for Network 
 Destination        Cost  Type       NextHop         AdvRouter       Area
 192.168.0.1/32     0     Stub       192.168.0.1     192.168.0.1     0.0.0.0
 192.168.1.0/30     1     Transit    192.168.1.1     192.168.0.1     0.0.0.0
 192.168.100.0/24   1     Stub       192.168.100.1   192.168.0.1     0.0.0.0
 192.168.0.2/32     1     Stub       192.168.1.2     192.168.0.2     0.0.0.0
 192.168.101.0/24   2     Stub       192.168.1.2     192.168.0.2     0.0.0.0

 Total Nets: 5  
 Intra Area: 5  Inter Area: 0  ASE: 0  NSSA: 0
PC>ping 192.168.101.1

Ping 192.168.101.1: 32 data bytes, Press Ctrl_C to break
From 192.168.101.1: bytes=32 seq=1 ttl=254 time=62 ms
From 192.168.101.1: bytes=32 seq=2 ttl=254 time=94 ms
From 192.168.101.1: bytes=32 seq=3 ttl=254 time=78 ms
From 192.168.101.1: bytes=32 seq=4 ttl=254 time=78 ms
From 192.168.101.1: bytes=32 seq=5 ttl=254 time=47 ms

--- 192.168.101.1 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 47/71/94 ms

This Post Has 0 Comments

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

Back To Top