CCNA(ENSA)-ospfv2-Single-Area

김상우·2022년 4월 4일
0

CCNA

목록 보기
7/14
post-thumbnail

OSPF Cost Metric

  • 라우팅 프로토콜은 Metric을 사용해 패킷의 최상의 경로를 결정하고 cost가 낮을수록 더 좋은 경로를 뜻한다.

  • Cost는 인터페이스의 대역폼에 반비례하며, 대역폭이 높으면 cost가 낮다.
    Cost = reference bandwidth(참조 대역폭) / interface bandwidth(인터페이스 대역폭)

    default reference bandwidth : 108{10^8}(100,000,000)
    Cost = 100,000,000 bps / interface bandwidth
    Cost는 정수여야만 한다.
    만약 정수보다 낮은 값이 계산된다면 가장 근접한 정수로 올림

  • Cost 계산 표

Interface TypeReference Bandwidth in bps / Default Bandwidth in bpsCost
10 Gigabit Ethernet (10Gbps)100,000,000 / 10,000,000,0000.01 = 1
Gigabit Ethernet (1 Gbps)100,000,000 / 1,000,000,0000.1 = 1
Fast Ethernet (100Mbps)100,000,000 / 100,000,0001
Ethernet (10Mbps)100,000,000 / 10,000,0001

Cost의 값을 변경하기 위해서는 Reference Bandwidth를 임의로 변경하면 된다.

  • Reference Bandwidth 수정
    • 실제 대역폭 용량에 미치는 영향은 없지만 계산적인 Metric 결과값에 영향을 끼침
    • Reference Bandwidth 변경 명령어 : auto-cost reference-bandwidth
    • Interface Bandwidth 변경 명령어 : ip ospf cost
    • 모든 라우터에 구성해야만 함
  • OSPD Cost 누적 계산
    • 라우터의 Cost는 출발지부터 목적지까지의 누적된 값이다.
  • OSPF Cost 수동 설정
    • 명령어 : ip ospf cost [value]
    • 사용 예시
    R1(config)# interface g0/0/1
    R1(config-if)# ip ospf cost 30
    R1(config-if)# interface lo0
    R1(config-if)# ip ospf cost 10
    R1(config-if)# end
    R1#
  • 백업 경로에 대한 테스트
    • 라우터가 연결이 끊어지는 경우 다른 경로를 사용하기 때문에 누적되는 Cost값이 달라진다.
  • Hello 와 Dead 간격 시간 검증
    • 인터페이스 당 Hello와 Dead 간격 시간을 지정할 수 있음
    • OSPF 간격이 서로 맞아야하며, 이웃 간의 인접 형성이 이루어지지 않는다.
    • Hello Timer를 10초로 설정하면 Dead Timer는 그의 4배인 40초가 된다.
    • 검증 확인 예시 (show ip ospf interface [인터페이스])
    R1# show ip ospf interface g0/0/0
    ...(생략)
      Timer intervals Configured, Hell0 10, Dead 40
    ...(생략)
    • 검증 확인 예시 (show ip ospf neighbor)
    R1# show ip ospf neighbor
    ~  Dead Time ~
    ~  00:00:35  ~
    ~  00:00:31  ~
  • Modify OSPFv2 Interval
    • 라우터는 빠른시간에 네트워크 다운을 감지하기 위해 OSPF Timer를 변경한다. 이 경우 트래픽은 증가하지만 빠른 수렴이 필요한 경우 사용한다.
    • 수렴시간 변경 예시 (ip ospf [hello/dead]-interval [seconds])
    Router(config-if)# ip ospf hello-interval [seconds]
    Router(config-if)# ip ospf dead-interval [sencond]
    • 수렴시간 초기화 명령어 : no ip ospf [hello/dead]-interval
    • 사용 예시
    R1(config)# interface g0/0/0
    R1(config-if)# ip ospf hello-interval 5
    R1(config-if)# ip ospf dead-interval 20
    R1(config-if)# 
    ...(생략)
    Neighbor Down: Dead timer expired
    R1(config-if)# end
    R1#

Default Route Propagation

  • Default Route Propagation(기본 경로 전파)를 하기 위해서 엣지 라우터(Edge Router)는 아래와 같이 구성해야한다.
    • ip 정적경로설정을 위한 명령어
      ip route 0.0.0.0 0.0.0.0 [next-hop-address | exit=intf]
    • 기본 경로구성 명령어
      `default-information originate
    • 예시
    R2(config)# interface lo1 
    R2(config)# ip address 64.100.0.1 255.255.255.252 
    R2(config-if)# exit 
    R2(config)# ip route 0.0.0.0 0.0.0.0 loopback 1 
    %Default route without gateway, if not a point-to-point interface, may impact performance 
    R2(config)# router ospf 10 
    R2(config-router)# default-information originate 
    R2(config-router)# end 
    R2#
  • 검증
    • 명령어를 사용해 기본경로 정보를 검증할 수 있다.
    • 명령어
      show ip route
    • 예시
    R2# show ip route | begin Gateway 
    Gateway of last resort is 0.0.0.0 to network 0.0.0.0 
    S* 	  0.0.0.0/0 is directly connected, Loopback1 
          10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
    (output omitted)
    R1# show ip route | begin Gateway 
    Gateway of last resort is 10.1.1.6 to network 0.0.0.0 
    O*E2  0.0.0.0/0 [110/1] via 10.1.1.6, 00:11:08, GigabitEthernet0/0/0      
          10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
    (output omitted)
profile
아침엔 운동하고 밤엔 잠을 잔다.

0개의 댓글