본문 바로가기

로그 저장소 :)/네트웍.Network

[CCNA] OSPF

                                ### OSPF (Open Shortest Path First)


-Open : 표준 개방형 Protocol

-Shortest Path First : SPF알고리즘을 사용하여 Loop가없는 경로를 보장한다.

                             [Dijikstra알고리즘]


-Link-State알고리즘

 .인접성이 맺어진 라우터 상호간 라우팅업데이트를 실시

 .Link변화시 변화된 부분에 대해서 부분적인 업데이트를 실시

 .변경사항이 없으면 업데이트를 실시하지 않는다.


-Classless

 .업데이트 정보안에 SubnetMask가 포함

 .VLSM , CIDR기능을 지원한다.

 .IP환경에서 확장성이 좋다.


-AD (Administrative Diatance)

 .Connect : 0

 .Static : 1

 .RIP : 120

 .EIGRP : Internal 90 , External 170 , Summary 5

 .OSPF : 110


-Metric : Cost(거리비용) = 10^8/Link당 Bandwidth

-Fastethernet : 100000000/100000000 = Cost 1

-Ethernet      : 100000000/10000000  = Cost 10

-Serial          : 100000000/1544000   = Cost 64

-R1 : 13.13.20.0/24 = Cost 65

-R1 : 13.13.23.0/24 = Cost 128

-R1 : 13.13.30.0/24 = Cost 129



                        13.13.12.0/24                13.13.23.0/24

               R1--------------------R2----------------------R3

                |                              |                               |

         13.13.10.0/24             13.13.20.0/24                 13.13.30.0/24



-로드분산

 .Router는 하나의 목적지에 대해서 최적경로 하나만을 지원하는 장비이다. 

 .로드분산 : 하나의 목적지에 대해서 복수개의 경로를 지원하는 기능

 .균등로드분산 : 최적경로와 동일한 metric을 가진 경로에 대해서 복수개의 경로를 지원하는 기능 (Default 4)



-업데이트 

 .출발지주소 출구 Interface의 IP를 사용

 .목적지 주소는 Multicast (224.0.0.5 , 224.0.0.6)를 사용

 .Protocol 89번을 사용


----------------------------------------------------------------------------------------


                         ### OSPF가 사용하는 5가지 PDU (Hello , DBD , LSR , LSU , LSA)


             # Hello

-OSPF Neighbor를 찾고 인접성의 조건을 비교하여 인접성의 조건이 일치하게되면

  인접성을 맺고 관계를 유지


-OSPF Hello (* = 인접성의 조건)

 .Area-ID *

 .Hello/Dead interval *

 .Subnet *

 .MTU *

 .Authentication *

 .Stub *

 .Router-ID

 .OSPF Priority


-인접성의 조건이 동일하면 Neighbor table을 생성하여 등록을 실시 : show ip ospf neighbor


-Network Type                 Hello/Dead                  DR/BDR                         Networ 환경

 .Broadcast 10/40 선출함(자동선출)      Ethernet

 .Point-to-point 10/40 선출안함      PPP , HDLC , F/R P2P

 .NBMA 30/120 선출함(수동선출)      F/R Multipoint , NBMA구간

 .Point-to-Multipoint 30/120 선출안함    없음




             # DBD (DDP)

-OSPF는 DataBase Table을 사용하여 모든 네트워크 정보를 관리한다.

-OSPF는 LSDB(Link-State DataBase)를 Area단위로 구분하여 관리

-OSPF는 Area내에서 LSA-Type(Link-State Advettisement-Type)별로 구분하여 관리하여 관리

-OSPF는 LSA(Link-State Advettisement)를 사용하여 LSDB(Link-State DataBase)를 동기화한다.

-OSPF는 대형망에서 사용되는 Protocol이므로 인접성이 완료되면 모든 네트워크 정보를

  업데이트하지 않고 Database Table의 요약본인 DBD를 교환하여 비교한후

  자신에게 없는 네트워크정보만을 요청하여 LSDB에 저장을 실시한다.




             # LSR (Link-State Request)

-OSPF의 상세정보 요청 Packet

-DBD교환후 자신에게 없는 네트워크 정보를 확인하거나 또는

  자신보다 최신의 정보를 발견하게되면 LSR을 사용하여 해당 네트워크의 상세정보를 요청한다.




             # LSU (Link-State Update)

-LSR에 대한 응답 Packet

-LSR을 수신한 Router는 해당 네트워크에대한 LSA(Link-State Advettisement)를 생성하여

  LSU에 담아 업데이트를 실시한다.




             # LSA (Link-State Ack)

-DBD , LSR , LSU에 대한 확인 Packet




-----------------------------------------------------------------------------------------


                       ### Area


-OSPF는 대형망에서 사용되는 Protocol이기때문에 네트워크의 변경은 불가피하다

 LSA에대한 Flooding의 범위를 줄이기위해서 Area단위를 사용한다. 

 [OSPF는 동일 Area간 LSDB를 동기화한다.]


-단일 Area를 사용시 <0-4294967296>중 하나를 선택하여 사용



-다중 Area를 사용시에는 반드시 Backbone Area를 사용해야하며

  모든 Area는 Backbone Area를 경유해서만 통신이 가능하다.

-같은 Network은 같은 Area에 포함되어야 한다.

-Backbone Area : Area 0


-ABR : Area경계사이에서 두 Aeea의 LSDB를 동기화하는 역할

-ASBR : 외부경계사이에 외부 정보를 OSPF로 재분배하는 Router




-----------------------------------------------------------------------------------------


                       ### DR/BDR (Designated Router/Backup Designated Router)


-Multi-Access : 하나의 Link를 사용하여 동일 네트워크상에서 다수의 장비와 연결되는 환경


-Muti-access환경에서 효율적인 통신을 실시하기위해서 OSPF는 DR/BDR을 선출하여 통신을 실시

   [모든 Router는 DR/BDR과 OSPF Neighbor를 형성]


-OSPF내에서 가장 큰 Priority값을 가진 Router가 DR로 선출되어지며

  두번째로 큰 Priority값을 가진 Rrouter가 BDR로 선출된다.


-만약 Priority값이 동일할경우 가장 큰 Router-ID를 가진 Router가 DR로 선출되며

  두번째로 큰 router-ID를 가진 Router가 BDR로 선출된다 (나머지는 DR other)


-OSPF에서 Priority 0은 해당 장비를 DR/BDR로 선출하지 않음을 의미한다.


-DR  ---->  DR other : 224.0.0.5 = OSPF All Router

-DR other  ---->  DR : 224.0.0.6 = DR


          [설정 방법]

interface Serial , Fa [Port number]

 ip ospf priority [0~255 : Default = 1]

!


-DR/BDR을 선출하는 네트워크 환경

 .Broadcast(자동선출) , NBMA(수동선출)


-DR/BDR을 선출하지않는 네트워크 환경 (DR이 존재하지 않기때문에 224.0.0.5만 사용)

 .Point-to-point , Point-to-Multipoint




-----------------------------------------------------------------------------------------


                       ### Router-ID


-OSPF에서 관리를 목적으로 사용며 식별자로 사용되는 값이므로 유일한 값을 가져야한다.


-Router-ID 선출시 우선순위

 1. 'Router-ID' command를 직접사용

 2. 해당 Router에 loopback interface가 존재하면  loopback interface안의 IP가 

     Router-ID로 등록된다.

 3. 해당 Router 에서 가장 큰 IP가 Router-ID로 등록된다.



-한번 선출된 Router-ID는 OSPF Process가 재시작되지 않는한  변경되지 않는다.




=================================================================================================


                        ### LSA-Type  (Link-State Advertisement-Type)


-O : Intra Area - 자신과 동일한 Area에 포함된 네트워크 

-O IA : Inter Area - 자신과 다른 Area에 포함된 네트워크

-O E1 : External - 외부 네트워크가 OSPF로 재분배되어진 네트워크 (누적 Metric)

-O E2 : External - 외부 네트워크가 OSPF로 재분배되어진 네트워크 (고정 Metric , Default Metric 20)



                         생성                       용도                   전파범위             R/T표기         D/T표기

-LSA-Type1 -  All Router      동일 Area간 통신시 사용         동일 Area               O              Router


-LSA-Type2 -     DR                DR의 정보를 전파         DR이 포함된 Area        표기X            Net


-LSA-Type3 -   ABR          다른 Arear간 통신시 사용     ABR이 포함된 Area      O IA         Summary Net


-LSA-Type4 -   ABR               ASBR의 정보를 전파      ABR이 포함된 Area       표기X       Summary ASB


-LSA-Type5 - ASBR         외부 네트워크를 OSPF전파     ASBR이 포함된 Area  O E1 , O E2      Type-5






=================================================================================================


                        ### Virtual-Link


-특정 Area가 Backbone Area를 경유하지 못할경우

 .해당 Area를 물리적으로 area  0에 인접하게 연결실시

 .해당 Area를 Backbone Area에 연결된 Area로 통합

 .Virtual-link를 사용하여 해당 Area를 Backbone Area에 논리적으로 연결

 을 통해서 해결이 가능하다.


-Virtual-Link는 ABR간 논리적인 연결을 실시하여 Backbone area에 연결되지 못한

  Area를 논리적으로 연결하는 기능




[OSPF PRE CONFIG]

                         #### OSPF Pre-config I



              ## R1


en

conf t

!

no ip domain-lo

!

line con 0

 password cisco

 login

 logging sy

 exec-t 0 0

!

line vty 0 4

 password cisco

 login

!

hostname R1

!

interface loopback 172

 ip address 172.16.1.1 255.255.255.0

!

interface fa 0/0

 no shutdown

 ip address 13.13.10.254 255.255.255.0

 bandwidth 100000

!

interface serial 1/0

 no shutdown

 encapsulation hdlc

 ip address 13.13.12.1 255.255.255.0

!







              ## R2



en

conf t

!

no ip domain-lo

!

line con 0

 password cisco

 login

 logging sy

 exec-t 0 0

!

line vty 0 4

 password cisco

 login

!

hostname R2

!

interface fa 0/0 

 no shutdown

 ip address 13.13.20.254 255.255.255.0

 bandwidth 100000

!

interface serial 1/1

 no shutdown

 encapsulation hdlc

 clock rate 1612800

 ip address 13.13.12.2 255.255.255.0

!

interface serial 1/0

 no shutdown

 encapsulation hdlc

 clock rate 1612800

 ip address 13.13.23.2 255.255.255.0

!







show ip ospf interface serial 1/x

!

              ## R3



en

conf t

!

no ip domain-lo

!

line con 0

 password cisco

 login

 logging sy

 exec-t 0 0

!

line vty 0 4

 password cisco

 login

!

hostname R3

!

interface loopback 172

 ip address 172.16.3.3 255.255.255.0

!

interface fa 0/0

 no shutdown

 ip address 13.13.30.254 255.255.255.0

 bandwidth 100000

!

interface serial 1/1

 no shutdown

 encapsulation hdlc

 ip address 13.13.23.3 255.255.255.0

!




================================================================================================



                         #### OSPF Pre-config II



              ## R1


en

conf t

!

no ip domain-lo

!

line con 0

 password cisco

 login

 logging sy

 exec-t 0 0

!

line vty 0 4

 password cisco

 login

!

hostname R1

!

interface loopback 172

 ip address 172.16.1.1 255.255.255.0

!

interface fa 0/0

 no shutdown

 ip address 13.13.10.254 255.255.255.0

 bandwidth 100000

!

interface serial 1/0

 no shutdown

 encapsulation hdlc

 ip address 13.13.12.1 255.255.255.0

!







              ## R2



en

conf t

!

no ip domain-lo

!

line con 0

 password cisco

 login

 logging sy

 exec-t 0 0

!

line vty 0 4

 password cisco

 login

!

hostname R2

!

interface fa 0/0 

 no shutdown

 ip address 13.13.20.254 255.255.255.0

 bandwidth 100000

!

interface serial 1/1

 no shutdown

 encapsulation hdlc

 clock rate 1612800

 ip address 13.13.12.2 255.255.255.0

!

interface fa 0/1

 no shutdown

 bandwidth 100000

 ip address 13.13.23.2 255.255.255.0

!








              ## R3



en

conf t

!

no ip domain-lo

!

line con 0

 password cisco

 login

 logging sy

 exec-t 0 0

!

line vty 0 4

 password cisco

 login

!

hostname R3

!

interface loopback 172

 ip address 172.16.3.3 255.255.255.0

!

interface fa 0/0

 no shutdown

 ip address 13.13.30.254 255.255.255.0

 bandwidth 100000

!

interface fa 0/1

 no shutdown

 bandwidth 100000

 ip address 13.13.23.3 255.255.255.0

!






================================================================================================



                         #### OSPF Pre-config III




              ## R1


en

conf t

!

no ip domain-lo

!

line con 0

 password cisco

 login

 logging sy

 exec-t 0 0

!

line vty 0 4

 password cisco

 login

!

hostname R1

!

interface loopback 172

 ip address 172.16.1.1 255.255.255.0

 ip ospf network point-to-point

!

interface fa 0/0

 no shutdown

 ip address 13.13.10.254 255.255.255.0

 bandwidth 100000

!

interface serial 1/0

 no shutdown

 encapsulation hdlc

 ip address 13.13.12.1 255.255.255.0

!

router ospf 100

 router-id 1.1.1.1

 network 172.16.1.1 0.0.0.0 area 0

 network 13.13.12.1 0.0.0.0 area 0

 network 13.13.10.254 0.0.0.0 area 0

!







              ## R2



en

conf t

!

no ip domain-lo

!

line con 0

 password cisco

 login

 logging sy

 exec-t 0 0

!

line vty 0 4

 password cisco

 login

!

hostname R2

!

interface loopback 172

 ip address 172.16.2.2 255.255.255.0

 ip ospf network point-to-point

!

interface fa 0/0 

 no shutdown

 ip address 13.13.20.254 255.255.255.0

 bandwidth 100000

!

interface serial 1/1

 no shutdown

 encapsulation hdlc

 clock rate 1612800

 ip address 13.13.12.2 255.255.255.0

!

interface serial 1/0

 no shutdown

 encapsulation hdlc

 clock rate 1612800

 ip address 13.13.23.2 255.255.255.0

!

router ospf 100

 router-id 2.2.2.2

 network 172.16.2.2 0.0.0.0 area 0

 network 13.13.12.2 0.0.0.0 area 0

 network 13.13.23.2 0.0.0.0 area 13

 network 13.13.20.254 0.0.0.0 area 13

!







              ## R3



en

conf t

!

no ip domain-lo

!

line con 0

 password cisco

 login

 logging sy

 exec-t 0 0

!

line vty 0 4

 password cisco

 login

!

hostname R3

!

interface loopback 130

 ip address 130.30.1.3 255.255.255.0

 ip address 130.30.2.3 255.255.255.0 secondary

!

interface loopback 172

 ip address 172.16.3.3 255.255.255.0

 ip ospf network point-to-point

!

interface fa 0/0

 no shutdown

 ip address 13.13.30.254 255.255.255.0

 bandwidth 100000

!

interface serial 1/1

 no shutdown

 encapsulation hdlc

 ip address 13.13.23.3 255.255.255.0

!

router ospf 100

 router-id 3.3.3.3

 network 172.16.3.3 0.0.0.0 area 113

 network 13.13.23.3 0.0.0.0 area 13

 network 13.13.30.254 0.0.0.0 area 13

 redistribute eigrp 100 subnet

!

router eigrp 100

 no auto-summary 

 network 130.30.1.3  0.0.0.0

 network 130.30.2.3  0.0.0.0

!





                                  #### OSPF Authentication


-OSPF는 Router와 Router간 인증을 실시하는Neighbor 인증기능과

  해당 Area내의 모든 Router에서 공통으로 인증기능을 사용하는 Area인증기능을 사용할수 있다.



                     ## Neighbor authentication 


-Router와 Router사이간의 인증기능



       # Plain Text authentication 


                  S1/0                   S1/1    S1/0                  S1/1

               R1----------------------R2----------------------R3


   # R1

interface serial 1/0

 ip ospf authentication

 ip ospf authentication-key cisco

!


   # R2

interface serial 1/1

 ip ospf authentication

 ip ospf authentication-key cisco

!


           정보확인


R1# debug ip ospf packet

*Mar  1 03:17:30.895: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2

      aid:0.0.0.0 chk:E693 aut:1 auk: from Serial1/0


-aut:0 = Authentication X

-aut:1 = Text Authentication

-aut:2 = MD5 Authentication








       # MD5 authentication 


                  S1/0                   S1/1    S1/0                  S1/1

               R1----------------------R2----------------------R3


   # R1

interface serial 1/0

 ip ospf authentication message-digest

 ip ospf message-digest-key 100 md5 cisco

!


   # R2

interface serial 1/1

 ip ospf authentication message-digest

 ip ospf message-digest-key 100 md5 cisco

!


           정보확인


R1#debug ip ospf packet 


*Mar  1 03:19:40.887: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2

      aid:0.0.0.0 chk:0 aut:2 keyid:100 seq:0x3C7EF2B9 from Serial1/0


-aut:0 = Authentication X

-aut:1 = Text Authentication

-aut:2 = MD5 Authentication




---------------------------------------------------------------------------------



                     ## Area authentication 


-해당 Area내에 포함된 모든 Router에서 공통을 설정을 실시해야한다.



       # Plain Text authentication 


                  S1/0                   S1/1    S1/0                  S1/1

               R1----------------------R2----------------------R3


    R1--R2


   # R1

interface serial 1/0

 ip ospf authentication

 ip ospf authentication-key cisco

!

router ospf 100 

 area 0 authentication 

!


   # R2

interface serial 1/1

 ip ospf authentication

 ip ospf authentication-key cisco

!

router ospf 100 

 area 0 authentication 

!



       # MD5 authentication 


                  S1/0                   S1/1    S1/0                  S1/1

               R1----------------------R2----------------------R3


   # R1

interface serial 1/0

 ip ospf authentication message-digest

 ip ospf message-digest-key 100 md5 cisco

!

router ospf 100 

 area 0 authentication message-digest

!


   # R2

interface serial 1/1

 ip ospf authentication message-digest

 ip ospf message-digest-key 100 md5 cisco

!

router ospf 100 

 area 0 authentication message-digest

!


   # R3  [R2와 Virtual-link를 연결하기위한 인증]

router ospf 100 

 area 0 authentication message-digest

!


           정보확인


R1#debug ip ospf packet 




-aut:0 = Authentication X

-aut:1 = Text Authentication

-aut:2 = MD5 Authentication













                        13.13.12.0/24                  13.13.23.0/24

              R1---------------------R2---------------------R3

                |                              |                               |

         13.13.10.0/24               13.13.20.0/24               13.13.30.0/24


-Process = 100

-Area = 0

-Router-ID = Router번호 사용


   # R1

router ospf 100

 router-id 1.1.1.1

 network 172.16.1.1 0.0.0.0 area 0

 network 13.13.12.1 0.0.0.0 area 0

 network 13.13.10.254 0.0.0.0 area 0

!

*Mar  1 00:04:27.099: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.2.2 on 

Serial1/0 from LOADING to FULL, Loading Done




   # R2

router ospf 100

 router-id 2.2.2.2

 network 13.13.12.2 0.0.0.0 area 0

 network 13.13.23.2 0.0.0.0 area 0

 network 13.13.20.254 0.0.0.0 area 0

!

*Mar  1 00:04:33.159: %OSPF-5-ADJCHG: Process 100, Nbr 1.1.1.1 on 

Serial1/1 from LOADING to FULL, Loading Done


*Mar  1 00:04:33.719: %OSPF-5-ADJCHG: Process 100, Nbr 3.3.3.3 on 

Serial1/0 from LOADING to FULL, Loading Done




   # R3

router ospf 100

 router-id 3.3.3.3

 network 172.16.3.3 0.0.0.0 area 0

 network 13.13.23.3 0.0.0.0 area 0

 network 13.13.30.254 0.0.0.0 area 0

!

*Mar  1 00:04:45.107: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.2.2 on 

Serial1/1 from LOADING to FULL, Loading Done



      정보확인


RTX# show ip route

RTX# show ip protocol

RTX# show ip ospf neighbor

RTX# show ip ospf database

RTX# show ip ospf interface serial , fastethernet [port number]




R1# ping 13.13.20.254 source 13.13.10.254  

R1# ping 13.13.30.254 source 13.13.10.254


R2# ping 13.13.10.254 source 13.13.20.254

R2# ping 13.13.30.254 source 13.13.20.254


R3# ping 13.13.10.254 source 13.13.30.254

R3# ping 13.13.20.254 source 13.13.30.254





=================================================================================================


                                   ## Passive-interface


-특정 Interface로 Broadcast/Multicast를 차단하는 기능



EX1) 각 Router는 OSPF업데이트가 필요한 Interface로만 OSPF PDU를 전송해야한다.


   # R1 , R3

router ospf 100

 passive-interface loopback 172

 passive-interface fastethernet 0/0

!


   # R2

router ospf 100

 passive-interface fastethernet 0/0

!




                  정보확인


R1# debug ip ospf hello    [Passive-interface 설정 전]

OSPF hello events debugging is on

*Mar  1 00:12:16.559: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 13.13.10.254

*Mar  1 00:12:16.563: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/0 from 13.13.12.1



R1# debug ip ospf hello    [Passive-interface 설정 후]

OSPF hello events debugging is on

*Mar  1 00:12:26.567: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/0 from 13.13.12.1







=================================================================================================


                                        ### 기준대역폭 변경


-기본적으로 OSPF는 Metric계산시 기준대역폭을 10^8을 사용한다

  [OSPF Meteric = Cost : 10^8/Link당 Bandwidth를 사용]


-FastEthernet : 100000000/100000000 = Cost 1

-Ethernet       : 100000000/10000000 = Cost 10

-Serial          : 100000000/1544000 = Cost 64

-GigaEthernet : 100000000/1000000000 = Cost 0.1이지만 Router는 소숫점을 계산하지 못하므로

  가장 작은 Metric인 Cost 1로 계산되어진다. 

  즉 OSPF는 FastEthernet과 GigaEthernet을 동급으로 인식하게된다.


-Router에서 FastEthernet과 GigaEthernet을 사용하여 이중화를 구현하게되면

 두 경로의 Metric 1로 계산되기때문에 균등로드분산이 실시된다.


-단 기준 대역폭변경시 OSPF로 여결된 모든 Router에서 공통으로 설정을 실시해야한다.



EX1) R3에 추후 R4가 추가될예정이다 (R3과 R4는 GigaEthenet으로 연결을 실시할 예정이다.)

       OSPF에서 정확한 Metric이 계산되로록 설정을 실시하시오 

        (GigaEthenet이 가장 작은 Metric으로 계산되어져야 한다.)


   # R1 , R2 , R3


router ospf 100

 auto-cost reference-bandwidth 1000  <--단위 Mbps [1000Mbps = 1000000000 = 10^9]

!


          [기준대역폭 변경 전]

-FastEthernet : 100000000/100000000 = Cost 1

-Ethernet       : 100000000/10000000 = Cost 10

-Serial          : 100000000/1544000 = Cost 64



          [기준대역폭 변경 전]

-FastEthernet  : 100000000/100000000 = Cost 10

-Ethernet       : 1000000000/10000000 = Cost 100

-Serial          :  1000000000/1544000 = Cost = 647










=================================================================================================


                                        ### Loopback interface


-OSPF에 Loopback interface의 주소는 하나의 Host로 인식되어지며 업데이트시 /32로 보여진다.


-해당 네트워크를 원래의 Subnet으로 업데이트를 실시하기위해서는

  네트워크 Type 을 변경해야한다.



EX1) OSPF의 모든 Router는 업데이트시 모든 네트워크가 원래의 Subnet으로 보여져야 한다.


   # R1

interface loopback 172

 ip ospf network point-to-point 

!


   # R3

interface loopback 172

 ip ospf network point-to-point 

!


            정보확인


R1# show ip ospf interface loopback 172   [Network Type 변경 전]

Loopback172 is up, line protocol is up 

  Internet Address 172.16.1.1/24, Area 0 

  Process ID 100, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1

  Loopback interface is treated as a stub Host




R1# show ip ospf interface loopback 172   [Network Type 변경 후]

Loopback172 is up, line protocol is up 

  Internet Address 172.16.1.1/24, Area 0 

  Process ID 100, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 1

  Transmit Delay is 1 sec, State POINT_TO_POINT

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

     ------------------ 중간 생략 ------------------




=================================================================================================



                           ## OSPF 인접성 단계


-Down State

 : OSPF의 시작 단계이며 자신은 Hello를 전송한후 수신을 기다리는 상태


-Init State

 : 자신은 Hello를 수신하고 송신하지 않은 상태


-2Way State

 : Hello Packet의 송/수신이 완료된 상태이며 상호간 Neighbor table에 Router-ID가 출력된다.


-Exstart State

 : Master Router와 Slave Router를 선출하는 단계이다.

  Master Router가 DBD를 먼저 전송하며 Slave Router가 DBD를 전송한다.

  큰 Router-ID를 가진 Router가 Master Router로 선출된다.


-Exchange State

 : DBD교환후 자신에게 없는 네트워크 정보를 LSR을 사용하여 해당 네트워크에 대한

   상세 정보를 요청하게된다.


-Loading State

 : LSR을 수신한 Router는 해당 네트워크에 대한  LSA(Link-State Advertisement)를 생성하여

   LSU를 사용하여 업데이트를 실시


-Full State

 : 인접성이 완료된 상태이며 비정상적인 활동으로인해 인접성이 단절되면 Down State로 전환된다.



-Attempt State [NBMA구간에서만 확인가능]

 : 'Neighbor' command를 사용하는 구간에서만 확인이 가능하며

   Full State에서 비정상적인 활동으로 인해 인접성이 단절되만 Attempt State로 전환된다.

  



                       [인접성 단계 확인]


R1# debug ip ospf adj


R1# clear ip ospf process

Reset ALL OSPF processes? [no]: y 


*Mar  1 00:15:44.687: OSPF: 2 Way Communication to 2.2.2.2 on Serial1/0, state 2WAY


*Mar  1 00:15:44.715: OSPF: NBR Negotiation Done. We are the SLAVE


*Mar  1 00:15:44.799: OSPF: Rcv DBD from 2.2.2.2 on Serial1/0 seq 0x1FFE opt 0x52 flag 0x1 len 32

  mtu 1500 state EXCHANGE


*Mar  1 00:15:44.843: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.2.2 on Serial1/0 from LOADING to FULL, 

Loading Done







=================================================================================================


                                        ### Router-ID변경


-OSPF에서 관리를 목적으로 사용하며

 OSPF내에서 식별자로 사용되는 값이므로 유일한 값을 가져야한다.


-Router-ID 선출시 우선순위

 1. 'Router-ID' command를 직접사용

 2. 해당 Router에 loopback interface가 존재하면  loopback interface안의 IP가 

     Router-ID로 등록된다.

 3. 해당 Router 에서 가장 큰 IP가 Router-ID로 등록된다.



-한번 선출된 Router-ID는 OSPF Process가 재시작되지 않는한  변경되지 않는다.



EX1) 아래의 조건에 맞게 설정을 실시하시오

 .R1의 Router-ID를 10.10.10.10으로 변경을 실시하시오

 .R2의 Router-ID를 20.20.20.20으로 변경을 실시하시오

 .R3의 Router-ID를 30.30.30.30으로 변경을 실시하시오



   # R1

R1(config)# router ospf 100

R1(config-router)# router-id 10.10.10.10

Reload or use "clear ip ospf process" command, for this to take effect

!

R1#clear ip ospf process

Reset ALL OSPF processes? [no]: y



   # R2

R2(config)# router ospf 100

R2(config-router)# router-id 20.20.20.20

Reload or use "clear ip ospf process" command, for this to take effect

!

R2#clear ip ospf process

Reset ALL OSPF processes? [no]: y



   # R3

R3(config)# router ospf 100

R3(config-router)# router-id 30.30.30.30

Reload or use "clear ip ospf process" command, for this to take effect

!

R3#clear ip ospf process

Reset ALL OSPF processes? [no]: y




                       정보확인


R1# show ip ospf neighbor

Neighbor ID     Pri   State            Dead Time   Address          Interface

20.20.20.20       0   FULL/  -        00:00:34      13.13.12.2       Serial1/1



R2# show ip ospf neighbor

Neighbor ID     Pri   State            Dead Time   Address          Interface

10.10.10.10       0   FULL/  -        00:00:34      13.13.12.1       Serial1/1

30.30.30.30       0   FULL/  -        00:00:35      13.13.23.3       Serial1/0



R3# show ip ospf neighbor

Neighbor ID     Pri   State            Dead Time   Address          Interface

20.20.20.20       0   FULL/  -        00:00:34      13.13.23.2       Serial1/1







=================================================================================================


                        ### LSA-Type  (Link-State Advertisement-Type)


-O : Intra Area - 자신과 동일한 Area에 포함된 네트워크 

-O IA : Inter Area - 자신과 다른 Area에 포함된 네트워크

-O E1 : External - 외부 네트워크가 OSPF로 재분배되어진 네트워크 (누적 Metric)

-O E2 : External - 외부 네트워크가 OSPF로 재분배되어진 네트워크 (고정 Metric , Default Metric 20)



                         생성                       용도                   전파범위             R/T표기         D/T표기

-LSA-Type1 -  All Router      동일 Area간 통신시 사용         동일 Area               O              Router


-LSA-Type2 -     DR                DR의 정보를 전파         DR이 포함된 Area        표기X            Net


-LSA-Type3 -   ABR          다른 Arear간 통신시 사용     ABR이 포함된 Area      O IA         Summary Net


-LSA-Type4 -   ABR               ASBR의 정보를 전파      ABR이 포함된 Area       표기X       Summary ASB


-LSA-Type5 - ASBR         외부 네트워크를 OSPF전파     ASBR이 포함된 Area  O E1 , O E2      Type-5






=================================================================================================


                        ### Virtual-Link


-특정 Area가 Backbone Area를 경유하지 못할경우

 .해당 Area를 물리적으로 area  0에 인접하게 연결실시

 .해당 Area를 Backbone Area에 연결된 Area로 통합

 .Virtual-link를 사용하여 해당 Area를 Backbone Area에 논리적으로 연결

 을 통해서 해결이 가능하다.


-Virtual-Link는 ABR간 논리적인 연결을 실시하여 Backbone area에 연결되지 못한

  Area를 논리적으로 연결하는 기능



   # R2

router ospf 100

 area 13 virtual-link 3.3.3.3

!


   # R3

router ospf 100

 area 13 virtual-link 2.2.2.2

!


             정보확인


R2# show ip ospf neighbor    [Virtual-link 연결 전]

Neighbor ID     Pri   State           Dead Time   Address         Interface

1.1.1.1             0   FULL/  -       00:00:30     13.13.12.1       Serial1/1

3.3.3.3             0   FULL/  -       00:00:36     13.13.23.3       Serial1/0


R2# show ip ospf neighbor    [Virtual-link 연결 후]

Neighbor ID     Pri   State           Dead Time   Address         Interface

3.3.3.3             0   FULL/  -           -          13.13.23.3       OSPF_VL0

1.1.1.1             0   FULL/  -       00:00:29     13.13.12.1       Serial1/1

3.3.3.3             0   FULL/  -       00:00:39     13.13.23.3       Serial1/0



R2# show ip ospf virtual-link

Virtual Link OSPF_VL0 to router 3.3.3.3 is up

  Run as demand circuit

  DoNotAge LSA allowed.

  Transit area 13, via interface Serial1/0, Cost of using 64

  Transmit Delay is 1 sec, State POINT_TO_POINT,

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

      ------------------ 중간 생략 ------------------



-R1 , R2에서 Area 113 네트워크 정보인 172.16.3.0/24 네트워크가 확인되어진다.





====================================================================================================



                              ### OSPF Authentication 


-OSPF는 지정된 장비와 업데이트시 정보의 위/변조를 방지하기 위해서 인증기능을 사용하여

  업데이트를 실시할수 있다.


-OSPF는 Router와 Router간 실시하는 Neighbor Authentication기능과

  해당 Area내의 모든 장비에서 실시하는 Area Authentication으로 구성이 가능하다.




                        ## Neighbor Authentication


-OSPF Router간 1:1로 인증 기능을 실시하는 기능


             # Neighbor Authentication  [Plain Text]


                    S1/0                           S1/1

                R1-----------------------------R2


   # R1

interface serial 1/0

 ip ospf authentication

 ip ospf authentication-key cisco

!



   # R2

interface serial 1/1

 ip ospf authentication

 ip ospf authentication-key cisco

!


             정보확인


R1# show ip ospf interface serial 1/0

    ---------- 중간 생략 ----------

  Simple password authentication enabled




R1# debug ip ospf packet

OSPF packet debugging is on

*Mar  1 00:17:42.527: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2

      aid:0.0.0.0 chk:E693 aut:1 auk: from Serial1/0


-aut : 0 = 인증기능을 사용하지 않은 상태

-aut : 1 = OSPF Text 인증 기능 사용

-aut : 2 = OSPF MD5 인증 기능 사용







             # Neighbor Authentication  [MD5]


                    S1/0                           S1/1

                R1-----------------------------R2



   # R1

interface serial 1/0

 ip ospf authentication message-digest

 ip ospf message-digest-key 100 md5 cisco

!


   # R2

interface serial 1/1

 ip ospf authentication message-digest

 ip ospf message-digest-key 100 md5 cisco

!


             정보확인


R1# show ip ospf interface serial 1/0

    ---------- 중간 생략 ----------

  Message digest authentication enabled

    Youngest key id is 100



R1# debug ip ospf packet

OSPF packet debugging is on

*Mar  1 00:18:02.627: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2

      aid:0.0.0.0 chk:0 aut:2 keyid:100 seq:0x3C7EC86E from Serial1/0



-aut : 0 = 인증기능을 사용하지 않은 상태

-aut : 1 = OSPF Text 인증 기능 사용

-aut : 2 = OSPF MD5 인증 기능 사용







            ----------------------------------------------------------


                        ## Area Authentication


-해당 Area내의 모든 Router가 실시하는 인증 기능

  [Authentication을 실시하는 Area내의 모든 Router에서 인증설정을 실시해야 한다.]


             # Area Authentication  [Plain Text]


                    S1/0                  S1/1    S1/0                  S1/1

                R1----------------------R2----------------------R3

                |---------Area 0-------|   |------Area 13--------|


   # R1

interface serial 1/0

 ip ospf authentication

 ip ospf authentication-key cisco

!

router ospf 100

 area 0 authentication

!



   # R2

interface serial 1/1

 ip ospf authentication

 ip ospf authentication-key cisco

!

router ospf 100

 area 0 authentication

!


             정보확인


R1# show ip ospf interface serial 1/0

    ---------- 중간 생략 ----------

  Simple password authentication enabled




R1# debug ip ospf packet

OSPF packet debugging is on

*Mar  1 00:17:42.527: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2

      aid:0.0.0.0 chk:E693 aut:1 auk: from Serial1/0


-aut : 0 = 인증기능을 사용하지 않은 상태

-aut : 1 = OSPF Text 인증 기능 사용

-aut : 2 = OSPF MD5 인증 기능 사용









             # Area Authentication  [MD5]


                    S1/0                  S1/1    S1/0                  S1/1

                R1----------------------R2----------------------R3

                |---------Area 0-------|   |------Area 13--------|


   # R1

interface serial 1/0

 ip ospf authentication message-digest

 ip ospf message-digest-key 100 md5 cisco

!

router ospf 100

 area 0 authentication message-digest

!


   # R2

interface serial 1/1

 ip ospf authentication message-digest

 ip ospf message-digest-key 100 md5 cisco

!

router ospf 100

 area 0 authentication message-digest

!


             정보확인


R1# show ip ospf interface serial 1/0

    ---------- 중간 생략 ----------

  Message digest authentication enabled

    Youngest key id is 100



R1# debug ip ospf packet

OSPF packet debugging is on

*Mar  1 00:18:02.627: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2

      aid:0.0.0.0 chk:0 aut:2 keyid:100 seq:0x3C7EC86E from Serial1/0



-aut : 0 = 인증기능을 사용하지 않은 상태

-aut : 1 = OSPF Text 인증 기능 사용

-aut : 2 = OSPF MD5 인증 기능 사용




-만약 Area 0 인증시 Virtual-link가 존재하게되면 Virtual-link인증도 실시해야한다.

  [Virtual-link도 논리적으로 Area  0에 연결되어있기때문에 인증을 실시해야한다.]


   # R3

router ospf 100

 area 0 authentication message-digest

!


R2# show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface

3.3.3.3             0   FULL/  -           -         13.13.23.3       OSPF_VL0

1.1.1.1             0   FULL/  -       00:00:37    13.13.12.1       Serial1/1

3.3.3.3             0   FULL/  -       00:00:39    13.13.23.3      Serial1/0




















'로그 저장소 :) > 네트웍.Network' 카테고리의 다른 글

[CCNA] EIGRP #2  (0) 2012.11.04
[CCNA] ACL  (0) 2012.11.04
[CCNA] RIP Ver2  (0) 2012.11.04
[CCNA] RIP  (0) 2012.11.04
[CCNA] Static Route  (0) 2012.11.04