동적 라우팅

◾ 범위
• IGP(Interior Gateway Protocol) : RIP(v1, v2), IGRP, OSPF
• EGP(Exterior Gateway Protocol) : EGP, BGP


◾ 라우팅 정보
• Distance Vector : RIP(v1, v2), IGRP
• Link State : OSPF


◾ VLSM
• Classful : RIP v1, IGRP
• Classless : RIP v2, OSPF


RIP

◾ Router에 RIP 설정
• 라우터가 알고있는 네트워크 정보를 광고하도록 지정한다.
• Classful 알고리즘이므로 넷마스크를 입력하지 않는다.
• 라우터에 연결된 모든 네트워크 정보를 모두 입력한다.

• 중간에 거쳐가는 라우터가 적은 쪽으로 이동


◾ 명령어
• router [rip | ospf | eigrp | bgp]
 : 각 프로토콜 설정모드로 진입
• network [IP]
 : 광고할 네트워크 주소를 지정
 - 라우터에 연결된 모든 네트워크 주소를 입력한다.
 - rip은 넷마스크를 입력하지 않는다.

 

◾ 라우팅 정보 확인
• show ip route [rip]

 

◾ 불필요한 업데이트 금지
• R1이나 R2, R3의 GigbitEthernet 영역은 라우팅 정보를 수신할 라우터가 없는 곳이므로 해당 인터페이스로 라우팅 정보를 업데이트 할 필요가 없다.
• passive‐interface [interface]
 : 해당 인터페이스로는 라우팅 정보를 업데이트하지 않는다.

R1(config-router)#passive-interface g0/0

 

RIP 실습

토폴로지 구성

R1

R1(config-if)#do show ip int brief
Interface              IP-Address      OK? Method Status                Protocol 
GigabitEthernet0/0     1.4.1.1         YES manual up                    up 
GigabitEthernet0/1     unassigned      YES unset  administratively down down 
Serial0/0/0            1.4.11.1        YES manual down                  down 
Serial0/0/1            1.4.13.2        YES manual down                  down 
Vlan1                  unassigned      YES unset  administratively down down

 

R2

R2(config-if)#do show ip int brief
Interface              IP-Address      OK? Method Status                Protocol 
GigabitEthernet0/0     1.4.2.1         YES manual up                    up 
GigabitEthernet0/1     unassigned      YES unset  administratively down down 
Serial0/0/0            1.4.11.2        YES manual up                    up 
Serial0/0/1            1.4.12.1        YES manual down                  down 
Vlan1                  unassigned      YES unset  administratively down down

 

R3

R3#show ip int brief
Interface              IP-Address      OK? Method Status                Protocol 
GigabitEthernet0/0     1.4.3.1         YES manual up                    up 
GigabitEthernet0/1     unassigned      YES unset  administratively down down 
Serial0/0/0            1.4.13.1        YES manual up                    up 
Serial0/0/1            1.4.12.2        YES manual up                    up 
Vlan1                  unassigned      YES unset  administratively down down

 

라우터 RIP 설정

R1, R2, R3 모두 설정한다.

R1(config)#router rip
R1(config-router)#network 1.4.1.0
R1(config-router)#network 1.4.11.0
R1(config-router)#network 1.4.13.0
R1(config-router)#passive-interface g0/0   < 불필요한 업데이트 금지

 

라우터 RIP 설정 확인

R1#show start
...
router rip
 network 1.0.0.0
...

 

라우팅 정보 확인

R1#show ip route
Codes: L - local, 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, E - EGP
       i - IS-IS, 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

     1.0.0.0/8 is variably subnetted, 9 subnets, 2 masks
C       1.4.1.0/24 is directly connected, GigabitEthernet0/0
L       1.4.1.1/32 is directly connected, GigabitEthernet0/0
R       1.4.2.0/24 [120/1] via 1.4.11.2, 00:00:27, Serial0/0/0
R       1.4.3.0/24 [120/1] via 1.4.13.1, 00:00:08, Serial0/0/1
C       1.4.11.0/24 is directly connected, Serial0/0/0
L       1.4.11.1/32 is directly connected, Serial0/0/0
R       1.4.12.0/24 [120/1] via 1.4.11.2, 00:00:27, Serial0/0/0
                    [120/1] via 1.4.13.1, 00:00:08, Serial0/0/1
C       1.4.13.0/24 is directly connected, Serial0/0/1
L       1.4.13.2/32 is directly connected, Serial0/0/1

 

PC에서 테스트

PC1

C:\>ping 1.4.2.11

Pinging 1.4.2.11 with 32 bytes of data:

Request timed out.
Reply from 1.4.2.11: bytes=32 time=5ms TTL=126
Reply from 1.4.2.11: bytes=32 time=6ms TTL=126
Reply from 1.4.2.11: bytes=32 time=5ms TTL=126

Ping statistics for 1.4.2.11:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 5ms, Maximum = 6ms, Average = 5ms
    
C:\>ping 1.4.3.11

Pinging 1.4.3.11 with 32 bytes of data:

Reply from 1.4.3.11: bytes=32 time=8ms TTL=126
Reply from 1.4.3.11: bytes=32 time=6ms TTL=126
Reply from 1.4.3.11: bytes=32 time=7ms TTL=126
Reply from 1.4.3.11: bytes=32 time=6ms TTL=126

Ping statistics for 1.4.3.11:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 6ms, Maximum = 8ms, Average = 6ms

RIP - extra

◾ 변경 정보 전달(Route Poisoning, Poisoning Reverse)
• 라우터에 변경(장애나 수정)이 발생하면 즉시 수정된 라우팅 정보를 전달한다.
• 이때 접근 이 불가능한 16 hops를 전달한다.
• R3의 G0/0을 다운시키고 전달되는 라우팅 정보를 확인한다.

 

R1#debug ip rip
RIP protocol debugging is on
R1#RIP: sending  v1 update to 255.255.255.255 via Serial0/0/0 (1.4.11.1)
RIP: build update entries
      network 1.4.1.0 metric 1
      network 1.4.3.0 metric 2
      network 1.4.13.0 metric 1
RIP: sending  v1 update to 255.255.255.255 via Serial0/0/1 (1.4.13.2)
RIP: build update entries
      network 1.4.1.0 metric 1
      network 1.4.2.0 metric 2
      network 1.4.11.0 metric 1
RIP: received v1 update from 1.4.13.1 on Serial0/0/1
      1.4.2.0 in 2 hops
      1.4.3.0 in 1 hops
      1.4.12.0 in 1 hops
RIP: received v1 update from 1.4.11.2 on Serial0/0/0
      1.4.2.0 in 1 hops
      1.4.3.0 in 2 hops
      1.4.12.0 in 1 hops
RIP: sending  v1 update to 255.255.255.255 via Serial0/0/0 (1.4.11.1)
RIP: build update entries
      network 1.4.1.0 metric 1
      network 1.4.3.0 metric 2
      network 1.4.13.0 metric 1
RIP: sending  v1 update to 255.255.255.255 via Serial0/0/1 (1.4.13.2)
RIP: build update entries
      network 1.4.1.0 metric 1
      network 1.4.2.0 metric 2
      network 1.4.11.0 metric 1
RIP: received v1 update from 1.4.13.1 on Serial0/0/1
      1.4.2.0 in 2 hops
      1.4.3.0 in 1 hops
      1.4.12.0 in 1 hops
RIP: received v1 update from 1.4.11.2 on Serial0/0/0
      1.4.2.0 in 1 hops
      1.4.3.0 in 2 hops
      1.4.12.0 in 1 hops
...
R1#no debug ip rip
RIP protocol debugging is off

 

RIP - extra : default route

◾ RIP을 이용한 default route 정보 전달
• 정적 라우팅 환경에서는 라우터에 직접 default route 정보를 설정했으나 RIP에서는 default route 정보를 RIP를 통해 전달 가능하다.
• 명령
 [ default‐information originate ]
 : RIP을 통해 default route 정보를 전달한다.


◾ Default router 설정
• default route 설정은 정적 라우팅 설정과 동일하다.
• 외부 네트워크로 local loopback 인터페이스를 이용한다. (가짜 인터페이스를 생성)
 - loopback 인터페이스를 인터넷(ISP) 연결로 간주한다. (default route로 지정)

 - no shutdown 으로 활성화를 할 필요가 없다. (가짜 인터페이스라서)

 

◾ loopback 인터페이스를 활성화 한다.

• 가상 인터페이스로 no shutdown 명령이 불필요하다.
• 10.10.10.0/24는 RIP 라우팅에 등록하지 않는다.

R1(config)#int loopback0

R1(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

R1(config-if)#ip address 10.10.10.1 255.255.255.0
R1(config-if)#do show ip int brief
Interface              IP-Address      OK? Method Status                Protocol 
GigabitEthernet0/0     1.4.1.1         YES manual up                    up 
GigabitEthernet0/1     unassigned      YES unset  administratively down down 
Serial0/0/0            1.4.11.1        YES manual up                    up 
Serial0/0/1            1.4.13.2        YES manual up                    up 
Loopback0              10.10.10.1      YES manual up                    up 
Vlan1                  unassigned      YES unset  administratively down down

 

◾ default route 인터페이스를 지정하고 이를 rip이 광고하도록 설정

R1(config)#ip route 0.0.0.0 0.0.0.0 loopback0
%Default route without gateway, if not a point-to-point interface, may impact performance
R1(config)#router rip
R1(config-router)#default-information originate 
R1(config-router)#exit
R1(config)#do show ip route
Codes: L - local, 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, E - EGP
       i - IS-IS, 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 0.0.0.0 to network 0.0.0.0

     1.0.0.0/8 is variably subnetted, 9 subnets, 2 masks
C       1.4.1.0/24 is directly connected, GigabitEthernet0/0
L       1.4.1.1/32 is directly connected, GigabitEthernet0/0
R       1.4.2.0/24 [120/1] via 1.4.11.2, 00:00:20, Serial0/0/0
R       1.4.3.0/24 [120/1] via 1.4.13.1, 00:00:24, Serial0/0/1
C       1.4.11.0/24 is directly connected, Serial0/0/0
L       1.4.11.1/32 is directly connected, Serial0/0/0
R       1.4.12.0/24 [120/1] via 1.4.13.1, 00:00:24, Serial0/0/1
                    [120/1] via 1.4.11.2, 00:00:20, Serial0/0/0
C       1.4.13.0/24 is directly connected, Serial0/0/1
L       1.4.13.2/32 is directly connected, Serial0/0/1
     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       10.10.10.0/24 is directly connected, Loopback0
L       10.10.10.1/32 is directly connected, Loopback0
S*   0.0.0.0/0 is directly connected, Loopback0

 

R2, R3에서도 default route 정보가 갱신되었는지 확인

R2#show ip route
Codes: L - local, 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, E - EGP
       i - IS-IS, 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 1.4.11.1 to network 0.0.0.0

     1.0.0.0/8 is variably subnetted, 9 subnets, 2 masks
R       1.4.1.0/24 [120/1] via 1.4.11.1, 00:00:08, Serial0/0/0
C       1.4.2.0/24 is directly connected, GigabitEthernet0/0
L       1.4.2.1/32 is directly connected, GigabitEthernet0/0
R       1.4.3.0/24 [120/1] via 1.4.12.2, 00:00:26, Serial0/0/1
C       1.4.11.0/24 is directly connected, Serial0/0/0
L       1.4.11.2/32 is directly connected, Serial0/0/0
C       1.4.12.0/24 is directly connected, Serial0/0/1
L       1.4.12.1/32 is directly connected, Serial0/0/1
R       1.4.13.0/24 [120/1] via 1.4.12.2, 00:00:26, Serial0/0/1
                    [120/1] via 1.4.11.1, 00:00:08, Serial0/0/0
R*   0.0.0.0/0 [120/1] via 1.4.11.1, 00:00:08, Serial0/0/0

 

'네트워크 공부 기록' 카테고리의 다른 글

OSPF  (0) 2022.01.18
RIP 라우팅 구현 실습  (0) 2022.01.17
정적 라우팅 구현 실습 (라우팅 정보 입력 및 Default 라우팅)  (0) 2022.01.14
Router 및 정적 라우팅  (0) 2022.01.14
VLAN 실습  (0) 2022.01.13

+ Recent posts