Network/GNS

[GNS] Routing Information Protocol(RIP) 예제

쓱은감자 2022. 5. 4. 22:21

Routing Information Protocol(RIP)

  • RIP는 OSI 7계층 중 Network 레이어에서 동작하는 라우팅(Routing Protocol)로 다이나믹 프로토콜입니다.
  • 내부용 라우팅 프로토콜(IGP)로 디스턴스 벡터(Distance Vector) 라우팅 프로토콜입니다.
  • RIP는 경로를 설정할 때 홉 카운트를 사용하고 최대 15 개이고 갱신 주기는 30초입니다.

RIP 설정 명령어

Router(config)# router rip
Router(config-router)# network 150.150.100.0

  • router rip는 현재 라우터에서 RIP 라우팅을 사용하겠다는 명령어입니다.
  • network 150.150.100.0은 라우팅을 사용할 네트워크를 지정하는 명령어로 서브넷 마스크를 입력하지 않고 Classful하게 모든 네트워크를 인식합니다.
    • 그렇기 때문에show running-config를 수행하면 네트워크가 150.150.100.0이 아닌 150.150.0.0으로 설정되어 있는 것을 확인할 수 있습니다.

RIP 예제-1

후니의 쉽게 쓴 CISCO 네트워킹 Vol.2 16p 예제

예제 구성도

RouterA 구성

  • 서울 리전에 있는 RouterA에 이더넷 및 라우팅 구성입니다.
  • 이더넷 설정
RouterA# configure terminal
RouterA(config)# interface ethernet 0/0
RouterA(config-if)# ip address 203.240.100.1 255.255.255.0

  • 시리얼 인터페이스 설정
RouterA# configure terminal
RouterA(config)# interface serial 2/0
RouterA(config-if)# ip address 203.240.150.1

  • RIP 구성
RouterA# configure terminal
RouterA(config)# router rip
RouterA(config-router)# network 203.240.100.0
RouterA(config-router)# network 203.240.150.0

RouterB 구성

  • 이더넷 설정
RouterA# configure terminal
RouterA(config)# interface ethernet 0/0
RouterA(config-if)# ip address 203.240.200.1 255.255.255.0

  • 시리얼 인터페이스 설정
RouterA# configure terminal
RouterA(config)# interface serial 2/0
RouterA(config-if)# ip address 203.240.150.2 255.255.255.0

  • rip 설정
RouterA# configure terminal
RouterA(config)# router rip
RouterA(config-router)# network 203.240.100.0
RouterA(config-router)# network 203.240.150.0

구성 확인

  • RouterA
    • show running-config
    • show ip protocol
    • show ip route

  •  RouterB
    • show running-config
    • show ip protocol
    • show ip route

RIP 예제-2

후니의 쉽게 쓴 CISCO 네트워킹 Vol.2 26p 예제

예제 구성

  • PC1에서 PC2로 통신이 가능하도록 설정

PC 설정

  • PC 1 ip 설정
    • ip 150.150.1.10 /16 150.150.1.1
  • PC 2 ip 설정
    • ip 172.70.100.10 /24 172.70.100.1

RouterC 구성

# conf t
# interface eth0/0
# no shutdown
# ip address 150.150.1.1 255.255.0.0
# interface Serial 2/0
# no shutdown
# ip address 203.210.200.2 255.255.255.0
# router rip
# network 150.150.0.0
# network 203.210.200.0

RouterA 구성

# conf t
# interface serial 2/1
# no shutdown
# ip address 203.210.200.1 255.255.255.0
# clockrate 128000    # 백투백 구성을 위한 설정
# interface serial 2/0
# no shutdown
# ip address 203.210.100.1 255.255.255.0
# clockrate 1007616
# router rip
# network 203.210.200.0
# network 203.210.100.0

Router C 구성

# conf t
# interface serial 2/0
# no shutdown
# ip address 203.210.100.2 255.255.255.0
# interface eth 0/0
# no shutdown
# ip address 172.70.100.1 255.255.255.0
# router rip
# network 203.210.100.0
# network 172.70.100.0

디버그

  • debug ip rip
  • 디버그는 반드시 꺼야됨
    • u all

연결 확인

  • PC1에서 PC2로 핑
    • ping 172.70.100.10

 

  • RouterC에서 RouterB로 핑
    • ping 172.70.100.1