Network&Cisco

Router TFTP Server


Router'ımız HTTP ve FTP server olabildiği gibi TFTP hizmeti de verebilmektedir.
Bunun için server tarafında;

tftp-server flash:cat6500-entservices-mz.122-40.SG.bin

Client tarafında;

copy tftp://1.1.1.1/cat6500-entservices-mz.122-40.SG.bin null:

Router FTP Server

Router'ımızı FTP server olarak yapılandırabilir ve çeşitli dosya kopyalama işlemlerimizi yapabiliriz. Örneğin güncellenmiş işimize yarayan IOS'u komşu router'dan FTP ile çekebiliriz. Bunun için server tarafında;

ftp-server enable
ftp-server topdir flash:
username ftp password ftp

Client tarafında;

ip ftp username ftp
ip ftp password ftp

Örneğin;
copy ftp://1.1.1.1/cat6500-entservices-mz.122-40.SG.bin null:

Router HTTP Server



Router'imizi HTTP yani Web server yapabiliriz. Bunu neden yapalim ki demeyin, IOS yükleme veya test işlemleri için çok gerekli olabiliyor.

Server konfigirasyonu;

ip http server
ip http path flash:
username http password http

Client tarafında;

ip http client username http
ip http client password http

Örneğin;

copy http://1.1.1.1/cat6500-entservices-mz.122-40.SG.bin null:



OSPF Network Types

OSPF'i öğrenmek için hangi network teknolojilerinde nasıl davranacağını bilmek zorundayız. Aynı zamanda network teknolojilerinin de OSPF'e nasıl davranacağını da bilmek zorundayız. Örneğin ethernet networklerde OSPF default olarak network tipi olarak "broadcast" seçip "hello"ları "Multicast" gönderirken "Frame-Relay"in doğasında multicast/broadcast yoktur. Oysaki OSPF komşuluk kurmak, DR-BDR seçmek isteyecektir. OSPF te bilinmesi gereken altın kurallardan biri de iki OSPF'in komşuluk kurabilmesi için "hello" ve "dead" timerların mutlaka eşleşmesi gerekir.

1- Broadcast:


R1(config-if)#do sh run int f0/0
Building configuration...

Current configuration : 110 bytes
!
interface FastEthernet0/0
ip address 1.1.1.1 255.255.255.0
ip ospf 1 area 0
duplex auto
speed auto
end

R2(config-if)#do sh run int f0/0
Building configuration...

Current configuration : 110 bytes
!
interface FastEthernet0/0
ip address 1.1.1.2 255.255.255.0
ip ospf 1 area 0
duplex auto
speed auto
end

Sonuçlar:

  • Default OSPF konfigirasyonu yaptığımızda asağıdaki "debug ip ospf hello" çıktısında da görüldüğü gibi R1, 224.0.0.5 adresine Multicast olarak hello gönderdi.
R1(config-if)#
*Mar 1 00:24:36.175: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 1.1.1.1

Asağıdaki çıktıya göre;
  • Ethernette default olarak network type "broadcast"tir.
  • Her 10 sn de bir "hello" gönderilir 40 sn hello alınmazsa komşuluk düşer.
  • DR-BDR seçimi yapılmış R1 DR olmuştur.
R1#show ip ospf interface
FastEthernet0/0 is up, line protocol is up
Internet Address 1.1.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Enabled by interface config, including secondary ip addresses
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 1.1.1.1
Backup Designated router (ID) 1.1.1.2, Interface address 1.1.1.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:01
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 4 msec, maximum is 4 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 1.1.1.2 (Backup Designated Router)
Suppress hello for 0 neighbor(s)

R1#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
1.1.1.2 1 FULL/BDR 00:00:30 1.1.1.2 FastEthernet0/0

2- Non-Broadcast:

Özellikle Frame Relay gibi non-broadcast multi access networklerde kullanılır. Bu tip netwoklerde multicast/broadcast olmadığı için "hello" paketleri gönderilemez haliyle komşuluk kurulamaz DR-BDR seçimi yapılamaz. Bu sorunu aşmak için OSPF paketlerini unicast göndermemiz gerekir bunu sağlamak içinde aşağıda görüldüğü gibi OSPF altında neighbor komutu ile HUB da SPOKE'ların adreslerini belirtmemiz gerekir. Yine SPOKE ların birbirleriyle R1 üzerinden haberleşebilmesi nedeniyle DR'ın mutlaka R1 olmasını sağlamak için interface altında "ip ospf priority 0" komutunu yazmamız gerekir.


!R1:

interface Loopback0

ip address 10.10.1.1 255.255.255.0

!

interface Serial1/0

ip address 10.10.123.1 255.255.255.0

encapsulation frame-relay

frame-relay map ip 10.10.123.2 102

frame-relay map ip 10.10.123.3 103

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

neighbor 10.10.123.2

neighbor 10.10.123.3

!

!R2:

!

interface Loopback0

ip address 10.10.2.2 255.255.255.0

!

interface Serial1/0

ip address 10.10.123.2 255.255.255.0

encapsulation frame-relay

ip ospf priority 0

frame-relay map ip 10.10.123.1 201

frame-relay map ip 10.10.123.3 201

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

!

!R3:

interface Loopback0

ip address 10.10.3.3 255.255.255.0

!

interface Serial1/0

ip address 10.10.123.3 255.255.255.0

encapsulation frame-relay

ip ospf priority 0

frame-relay map ip 10.10.123.1 301

frame-relay map ip 10.10.123.2 301

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

!

Sonuçlar:

  • Hello paketleri unicast gönderilmektedir.
  • Frame Relay networklerde default network tipi non-broadcast' tir.
  • DR/BDR seçimi yapılmaktadır.
  • Timers: Hello 30, Dead 120
  • Neighbor komutu gereklidir.

*Mar 1 00:25:25.951: OSPF: Send hello to 10.10.123.2 area 0 on Serial1/0 from 10.10.123.1

*Mar 1 00:25:25.955: OSPF: Send hello to 10.10.123.3 area 0 on Serial1/0 from 10.10.123.1


R1#sh ip ospf interface s1/0

Serial1/0 is up, line protocol is up

Internet Address 10.10.123.1/24, Area 0

Process ID 1, Router ID 10.10.1.1, Network Type NON_BROADCAST, Cost: 64

Transmit Delay is 1 sec, State DR, Priority 1

Designated Router (ID) 10.10.1.1, Interface address 10.10.123.1

No backup designated router on this network

Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5

oob-resync timeout 120

Hello due in 00:00:01

Supports Link-local Signaling (LLS)

Index 1/1, flood queue length 0

Next 0x0(0)/0x0(0)

Last flood scan length is 1, maximum is 1

Last flood scan time is 0 msec, maximum is 4 msec

Neighbor Count is 2, Adjacent neighbor count is 2

Adjacent with neighbor 10.10.2.2

Adjacent with neighbor 10.10.3.3

Suppress hello for 0 neighbor(s)


R1#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.10.2.2 0 FULL/DROTHER 00:01:34 10.10.123.2 Serial1/0

10.10.3.3 0 FULL/DROTHER 00:01:58 10.10.123.3 Serial1/0


3- Point-to-Point:

  • PPP, HDLC, Frame Relay Point-to-Point interfacelerde default OSPF network tipidir.
  • Timers: Hello 10, Dead 40
  • "sh ip ospf neighbor"ciktisinda da görüldüğü gibi DR/BDR seçimi yoktur.
  • Hello paketleri multicast olarak 224.0.0.5 adresine gönderilir.

*Mar 1 00:31:15.139: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/0.12 from 10.1.12.1


R1#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.10.2.2 0 FULL/ - 00:00:33 10.1.12.2 Serial1/0.12

R1#sh ip ospf interface s1/0.12

Serial1/0.12 is up, line protocol is up

Internet Address 10.1.12.1/24, Area 0

Process ID 1, Router ID 10.10.1.1, Network Type POINT_TO_POINT, Cost: 64

Transmit Delay is 1 sec, State POINT_TO_POINT,

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

oob-resync timeout 40

Hello due in 00:00:02

Supports Link-local Signaling (LLS)

Index 1/1, flood queue length 0

Next 0x0(0)/0x0(0)

Last flood scan length is 1, maximum is 1

Last flood scan time is 0 msec, maximum is 0 msec

Neighbor Count is 1, Adjacent neighbor count is 1

Adjacent with neighbor 10.10.2.2

Suppress hello for 0 neighbor(s)


R1#sh run

interface Serial1/0

no ip address

encapsulation frame-relay

!

interface Serial1/0.12 point-to-point

ip address 10.1.12.1 255.255.255.0

frame-relay interface-dlci 102

!


4- Point to Multipoint Broadcast:

  • Hello'lar multicast olarak 224.0.0.5 adresine gönderilir.
  • Routing tablosuna /32'li host route'lar eklenir.
  • DR/BDR secimi yoktur.
  • Timers: Hello 30, Dead 120
  • Neighbor belirtmeye gerek yoktur.

*Mar 1 01:10:43.727: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/0 from 10.10.123.1

R1#sh run
interface Serial1/0
ip address 10.10.123.1 255.255.255.0
encapsulation frame-relay
ip ospf network point-to-multipoint
frame-relay map ip 10.10.123.2 102 broadcast
frame-relay map ip 10.10.123.3 103 broadcast
!

R1#sh ip route
Codes: 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

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O 10.10.3.3/32 [110/65] via 10.10.123.3, 00:01:41, Serial1/0
O 10.10.2.2/32 [110/65] via 10.10.123.2, 00:01:41, Serial1/0
C 10.10.1.0/24 is directly connected, Loopback0
O 10.10.123.3/32 [110/64] via 10.10.123.3, 00:01:41, Serial1/0
O 10.10.123.2/32 [110/64] via 10.10.123.2, 00:01:41, Serial1/0
C 10.10.123.0/24 is directly connected, Serial1/0

R1#sh ip osp int s1/0
Serial1/0 is up, line protocol is up
Internet Address 10.10.123.1/24, Area 0
Process ID 1, Router ID 10.10.1.1, Network Type POINT_TO_MULTIPOINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT,
Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
oob-resync timeout 120
Hello due in 00:00:00
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 10.10.2.2
Adjacent with neighbor 10.10.3.3
Suppress hello for 0 neighbor(s)

R1#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
10.10.2.2 0 FULL/ - 00:01:35 10.10.123.2 Serial1/0
10.10.3.3 0 FULL/ - 00:01:33 10.10.123.3 Serial1/0

Detaylı bilgi için burayı tıklayabilirsiniz.

4- Point to Multipoint Non-Broadcast:

  • Hello'lar unicast gönderilir.
  • Routing tablosuna /32'li host route'lar eklenir.
  • DR/BDR secimi yoktur.
  • Timers: Hello 30, Dead 120
  • Nonbroadcast ortam olduğundan neighbor yazmak gereklidir.


R1#sh run
Building configuration...
!
interface Serial1/0
ip address 10.10.123.1 255.255.255.0
encapsulation frame-relay
ip ospf network point-to-multipoint non-broadcast
frame-relay map ip 10.10.123.2 102
frame-relay map ip 10.10.123.3 103
!
router ospf 1
network 0.0.0.0 255.255.255.255 area 0
neighbor 10.10.123.3
neighbor 10.10.123.2
!

*Mar 1 00:15:39.895: OSPF: Send hello to 10.10.123.3 area 0 on Serial1/0 from 10.10.123.1
*Mar 1 00:15:39.899: OSPF: Send hello to 10.10.123.2 area 0 on Serial1/0 from 10.10.123.1

R1#sh ip osp int s1/0
Serial1/0 is up, line protocol is up
Internet Address 10.10.123.1/24, Area 0
Process ID 1, Router ID 10.10.1.1, Network Type POINT_TO_MULTIPOINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_MULTIPOINT,
Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
oob-resync timeout 120
Hello due in 00:00:26
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 2, maximum is 2
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 10.10.3.3
Adjacent with neighbor 10.10.2.2
Suppress hello for 0 neighbor(s)

R1#sh ip osp nei

Neighbor ID Pri State Dead Time Address Interface
10.10.3.3 0 FULL/ - 00:01:34 10.10.123.3 Serial1/0
10.10.2.2 0 FULL/ - 00:01:34 10.10.123.2 Serial1/0

R1#sh ip route
Codes: 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

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O 10.10.3.3/32 [110/65] via 10.10.123.3, 00:17:46, Serial1/0
O 10.10.2.2/32 [110/65] via 10.10.123.2, 00:17:46, Serial1/0
C 10.10.1.0/24 is directly connected, Loopback0
O 10.10.123.3/32 [110/64] via 10.10.123.3, 00:17:46, Serial1/0
O 10.10.123.2/32 [110/64] via 10.10.123.2, 00:17:46, Serial1/0
C 10.10.123.0/24 is directly connected, Serial1/0


Olası Problemler:

Güzelce OSPF konfigirasyonu yaptınız fakat komşuluklar kurulmadığında ne yapabiliriz?
İlk yapmamız gereken şey "debug" açmaktır. Aşağıdaki örneğe bakarsak;

R2#debug ip ospf events
*Mar 1 00:33:09.583: OSPF: Mismatched hello parameters from 10.10.123.1
*Mar 1 00:33:09.587: OSPF: Dead R 120 C 40, Hello R 30 C 10

Görüldüğü gibi "hello" parametreleri uyuşmamıştır. Bu durumda OSPF network typle'larını kontrol edebiliriz veya bu parametlere manuel bir müdahale yapmamız gerekir.
Hatta konfigirasyona başlamadan önce sadece ilgili "debug"ları açarak kontrollu bir şekilde yolumuza devam edebiliriz, özellikle de "redistribution" yaparken "debug" çıktıları çok işimize yaramaktadır.








Konfigirayon Yedekleme ve Geri Alma (Configiration Archive and Rollback)

Cisco cihazlarda konfigirasyon yedegi almak cok onemli ve mutlaka yapılması gereken bir iştir. Problem oluştuğunda önceki konfigirasyonlara dönebilmek sistemin arıza süresini kısaltarak EoC'i (end of career) önler:)

Bu işlemi yapmadan önce yedeği nereye nasil ve ne zaman alacağımıza karar vermemiz gerekir. Benim tavsiyem yedeklerin değişiklik yapıldığında ve güvenli bir ftp sunucuya alınmasıdır.

FTP sunucu ayarladıktan sonra kullanıcımızı oluşturalım:


ip ftp username mcap

ip ftp password secret


Bu islemden sonra yer ve zaman bilgilerini girelim:


archive

path ftp://10.1.1.1/R1-config

write-memory


Yukarida cihazımızda yaptığımız değişiklikleri kaydetmek icin komut verdiğimizde konfigirasyon dosyasi tanımladığımız FTP sunucuya gönderilecektir.


R1#show archive

The next archive file will be named ftp://10.1.1.1/R1-config-2

Archive # Name

0

1 ftp://10.1.1.1/R1-config-1 <- Most Recent

2

3

4

5

6

7

8

9

10

11

12

13

14


Peki acaba FTP'ye kaydettigimiz konfigirasyon dosyasiyla şu anda çalışan sistem dosyasi arasinda fark varmıdır? Bunu anlamak için hemen bir loopback interface oluşturup IP verelim ve nasıl karşılaştıracağımıza bakalım:


R1#show archive config differences ftp://10.1.1.1/R1-config-1 system:running-config

Contextual Config Diffs:

+interface Loopback99

+ip address 1.1.1.1 255.255.255.255


FTP'deki sistem dosyasini çalışan konfig dosyasiyla değiştirmek için yani yedekten geri dönmek için:


R1#configure replace ftp://10.1.1.1/R1-config-1 list force

Loading R1-config-1 !!

[OK - 7400/4096 bytes]

!Pass 1

!List of Commands:

no interface Loopback99

end

Total number of passes: 1

Rollback Done

Konfigirasyon değişikliği uyarıları ve kaydetme(Configiration change notification and logging)

Cisco cihazlarda kimin hangi komutlari yürüttüğünü nasil anlarız?
Bu konu network yöneticileri için çok önemlidir. Özellikle probleme neden olan en son degisikliğin ne olduğunu ve kimin yaptığını bulma hususunda...



R1(config)#archive
R1(config-archive)#log config
R1(config-archive-log-cfg)#logging enable
R1(config-archive-log-cfg)#notify syslog
R1(config-archive-log-cfg)#hidekeys



005851: *Nov 1 16:46:57: %PARSER-5-CFGLOG_LOGGEDCMD: User:mcap logged command:no ip domain-lookup

R1#show archive log config all
idx sess user@line Logged command
1 1 mcap@vty0 | logging enable
2 1 mcap@vty0 | notify syslog
3 1 mcap@vty0 | hidekeys
4 2 mcap@vty0 |no ip domain-lookup

R1#show archive log config all provisioning
archive
log config
logging enable
notify syslog
hidekeys
no ip domain-lookup

R1#show archive log config statistics
Config Log Session Info:
Number of sessions being tracked: 1
Memory being held: 3905 bytes
Total memory allocated for session tracking: 7810 bytes
Total memory freed from session tracking: 3905 bytes

Config Log log-queue Info:
Number of entries in the log-queue: 4
Memory being held by the log-queue: 1089 bytes
Total memory allocated for log entries: 1089 bytes
Total memory freed from log entries: 0 bytes


Switchlerde trafik kontrolu

Storm-control ve srr-queue bandwith limit farkı:

Storm-control LAN a dogru alışılmışın dışındaki trafiklerin kontrol altına alınması amacına hizmet eden bir mekanizmadır. Cunkü bu kontrolsüz trafik performansı ciddi anlamda düşürür, wormlar sayesinde zaten çoğumuzun başından böyle bir hikaye geçmiştir. Yanda şekilde de görüldüğü gibi belirlenen eşik değerini aşan trafik normale yani eşik değerinin altına ininceye kadar bloklanir. Bu bloklama broadcast, multicast veya unicast trafik için yapılabilir. Bloklanan trafik için log tutulması güzel bir özelliktir. Eğer iki bloklama işlemi ayni anda ayarlanirsa bitanesinin eşik değerini geçmesi bloklama işlemi için yeterlidir. Trafik normale donunceye kadar ayarlanan 2 trafik işlemi icinde bloklama devam eder.
Asagidaki örnekte FastEthernet 0/1 trafigi 1Mb i geçerse bu değerin altına ininceye kadar trafik bloklanır.
Switch(config)# interface fastethernet0/1
Switch(config-if)# storm-control unicast level bps 1m
Ayrıntılı bilgi için burayı tıklayınız.

Switchlerde port bazli trafigi kontrol etmenin diger yoluda bir QoS mekanizmasi olan srr-queue bandwidth limit paremetresidir.
Switch uzerinde mls qos komutu ile servisi çalıştırdıktan sonra interface altinda komutu yazabiliriz. Örnegin FastEthernet 0/1 de trafigimizin %50 sini bloklamak istersek;
Switch(config)# interface fastethernet0/1
Switch(config-if)# srr-queue bandwidth limit 50
Yukarıda görüldüğü gibi interface den gecen trafigin yarisi drop edilecek sekilde ayarlama yapildi bu da 100Mb lik ethernet baglantisinin 50Mb lik kısmının kullanılabileceği anlamına gelir. Daha ayrıntılı bilgi için buraya tiklayiniz.

Sonuc olarak yukarıdada anlatıldıgı gibi switchlerimizde trafigimizi 2 yontemlede kontrol altına alabiliyoruz peki bu 2 yöntemin bir farkı varmı? Elbette var;
storm-control inbound yöndeki trafiği kontrol ederken, SRR diğer QoS mekanizmalarinda olduğu gibi giden trafiği kontrol etmemizi sağlar.