STATIC=====================================
R12(config)# ip route 0.0.0.0 0.0.0.0 1.4.2.1

R11(config)# ip route 0.0.0.0 0.0.0.0 1.4.1.1
R11(config)# ip route 1.4.3.0 255.255.255.0 1.4.2.2

RC(config)#ip route 1.4.2.0 255.255.255.0 1.4.1.2
RC(config)#ip route 1.4.3.0 255.255.255.0 1.4.1.2


RIPv2 =======================================
R22(config)#router rip
R22(config-router)#version 2
R22(config-router)#no auto-summary
R22(config-router)#network 2.4.3.1
R22(config-router)#network 2.4.2.2
R22(config-router)#passive-interface g0/0

R21(config)#router rip
R21(config-router)#version 2
R21(config-router)#no auto-summary
R21(config-router)#network 2.4.2.1
R21(config-router)#network 2.4.1.2

RC(config)#router rip
RC(config-router)#version 2
RC(config-router)#no auto-summary
RC(config-router)#network 1.4.1.1
RC(config-router)#network 2.4.1.1
RC(config-router)#network 3.4.1.1
RC(config-router)#network 4.4.1.1

+
RC(config)#router rip
RC(config-router)#redistribute static
RC(config-router)#redistribute ospf 1 metric 5
RC(config-router)#redistribute eigrp 100 metric 5


OSPF=======================================
R32(config)#router ospf 1
R32(config-router)#router-id 3.4.3.1
R32(config-router)#network 3.4.3.1 0.0.0.0 area 0
R32(config-router)#network 3.4.2.2 0.0.0.0 area 0
R32(config-router)#passive-interface g0/0

R31(config)#router ospf 1
R31(config-router)#router-id 3.4.2.1
R31(config-router)#network 3.4.2.1 0.0.0.0 area 0
R31(config-router)#network 3.4.1.2 0.0.0.0 area 0

RC(config)#router ospf 1
RC(config-router)#router-id 3.4.1.1
RC(config-router)#network 1.4.1.1 0.0.0.0 area 0
RC(config-router)#network 2.4.1.1 0.0.0.0 area 0
RC(config-router)#network 3.4.1.1 0.0.0.0 area 0
RC(config-router)#network 4.4.1.1 0.0.0.0 area 0

+
RC(config)#router ospf 1
RC(config-router)#redistribute static subnets
RC(config-router)#redistribute rip subnets
RC(config-router)#redistribute eigrp 100 metric 10 subnets


EIGRP======================================
R42(config)#router eigrp 100
R42(config-router)#network 4.4.3.1 0.0.0.0
R42(config-router)#network 4.4.2.2 0.0.0.0
R42(config-router)#passive-interface g0/0

R41(config)#router eigrp 100
R41(config-router)#network 4.4.2.1 0.0.0.0
R41(config-router)#network 4.4.1.2 0.0.0.0

RC(config)#router eigrp 100
RC(config-router)#network 1.4.1.1 0.0.0.0
RC(config-router)#network 2.4.1.1 0.0.0.0
RC(config-router)#network 3.4.1.1 0.0.0.0
RC(config-router)#network 4.4.1.1 0.0.0.0

+
RC(config)#router eigrp 100
RC(config-router)#redistribute static
RC(config-router)#redistribute rip metric 10000 10 255 1 1500
RC(config-router)#redistribute ospf 1 metric 10000 10 255 1 1500

 

RIP - OSPF

OSPF=======================================
Rr2(config)#router ospf 1
Rr2(config-router)#router-id 192.4.23.1
Rr2(config-router)#network 192.4.23.1 0.0.0.0 area 0
Rr2(config-router)#network 192.4.22.2 0.0.0.0 area 0
Rr2(config-router)#passive-interface g0/0

Rr1(config)#router ospf 1
Rr1(config-router)#router-id 192.4.22.1
Rr1(config-router)#network 192.4.22.1 0.0.0.0 area 0
Rr1(config-router)#network 192.4.21.1 0.0.0.0 area 0

Rm(config)#router ospf 1
Rm(config-router)#router-id 192.4.21.10
Rm(config-router)#network 192.4.21.10 0.0.0.0 area 0
Rm(config-router)#network 192.4.11.10 0.0.0.0 area 0
Rm(config-router)#redistribute rip subnets

RIPv2 =======================================
Rs2(config)#router rip
Rs2(config-router)#version 2
Rs2(config-router)#no auto-summary
Rs2(config-router)#network 192.4.13.1
Rs2(config-router)#network 192.4.12.2
Rs2(config-router)#passive-interface g0/0

Rs1(config)#router rip
Rs1(config-router)#version 2
Rs1(config-router)#no auto-summary
Rs1(config-router)#network 192.4.12.1
Rs1(config-router)#network 192.4.11.1

Rm(config)#router rip
Rm(config-router)#version 2
Rm(config-router)#no auto-summary
Rm(config-router)#network 192.4.11.10
Rm(config-router)#network 192.4.21.10
Rm(config-router)#redistribute ospf 1 metric 5

RIP_OSPF세팅.pkt
0.05MB


RIP - EIGRP

RIPv2 =======================================
Rs2(config)#router rip
Rs2(config-router)#version 2
Rs2(config-router)#no auto-summary
Rs2(config-router)#network 192.4.13.1
Rs2(config-router)#network 192.4.12.2
Rs2(config-router)#passive-interface g0/0

Rs1(config)#router rip
Rs1(config-router)#version 2
Rs1(config-router)#no auto-summary
Rs1(config-router)#network 192.4.12.1
Rs1(config-router)#network 192.4.11.1

Rm(config)#router rip
Rm(config-router)#version 2
Rm(config-router)#no auto-summary
Rm(config-router)#network 192.4.11.10
Rm(config-router)#network 192.4.21.10
Rm(config-router)#redistribute eigrp 100 metric 5


EIGRP======================================
Rr2(config)#router eigrp 100
Rr2(config-router)#network 192.4.23.1 0.0.0.0
Rr2(config-router)#network 192.4.22.2 0.0.0.0
Rr2(config-router)#passive-interface g0/0

Rr1(config)#router eigrp 100
Rr1(config-router)#network 192.4.22.1 0.0.0.0
Rr1(config-router)#network 192.4.21.1 0.0.0.0

Rm(config)#router eigrp 100
Rm(config-router)#network 192.4.11.10 0.0.0.0
Rm(config-router)#network 192.4.21.10 0.0.0.0
Rm(config-router)#redistribute rip metric 10000 10 255 1 1500

RIP_EIGRP세팅.pkt
0.05MB


OSPF - EIGRP

OSPF=======================================
Rs2(config)#router ospf 1
Rs2(config-router)#router-id 192.4.13.1
Rs2(config-router)#network 192.4.13.1 0.0.0.0 area 0
Rs2(config-router)#network 192.4.12.2 0.0.0.0 area 0
Rs2(config-router)#passive-interface g0/0

Rs1(config)#router ospf 1
Rs1(config-router)#router-id 192.4.12.1
Rs1(config-router)#network 192.4.12.1 0.0.0.0 area 0
Rs1(config-router)#network 192.4.11.1 0.0.0.0 area 0

Rm(config)#router ospf 1
Rm(config-router)#router-id 192.4.11.10
Rm(config-router)#network 192.4.21.10 0.0.0.0 area 0
Rm(config-router)#network 192.4.11.10 0.0.0.0 area 0
Rm(config-router)#redistribute eigrp 100 metric 10 subnets

EIGRP======================================
Rr2(config)#router eigrp 100
Rr2(config-router)#network 192.4.23.1 0.0.0.0
Rr2(config-router)#network 192.4.22.2 0.0.0.0
Rr2(config-router)#passive-interface g0/0

Rr1(config)#router eigrp 100
Rr1(config-router)#network 192.4.22.1 0.0.0.0
Rr1(config-router)#network 192.4.21.1 0.0.0.0

Rm(config)#router eigrp 100
Rm(config-router)#network 192.4.11.10 0.0.0.0
Rm(config-router)#network 192.4.21.10 0.0.0.0
Rm(config-router)#redistribute ospf 1 metric 10000 10 255 1 1500

OSPF_EIGRP세팅.pkt
0.05MB

 

아래와 같이 토폴로지를 구성하고 IP는 미리 세팅한후 실습한다.

STATIC(공통)=================================
Rs2(config)# ip route 0.0.0.0 0.0.0.0 192.4.12.1

Rs1(config)# ip route 0.0.0.0 0.0.0.0 192.4.11.10
Rs1(config)# ip route 192.4.13.0 255.255.255.0 192.4.12.2

Rm(config)#ip route 192.4.12.0 255.255.255.0 192.4.11.1
Rm(config)#ip route 192.4.13.0 255.255.255.0 192.4.11.1


OSPF=======================================
Rr2(config)#router ospf 1
Rr2(config-router)#router-id 192.4.23.1
Rr2(config-router)#network 192.4.23.1 0.0.0.0 area 0
Rr2(config-router)#network 192.4.22.2 0.0.0.0 area 0
Rr2(config-router)#passive-interface g0/0

Rr1(config)#router ospf 1
Rr1(config-router)#router-id 192.4.22.1
Rr1(config-router)#network 192.4.22.1 0.0.0.0 area 0
Rr1(config-router)#network 192.4.22.1 0.0.0.0 area 0
Rr1(config-router)#network 192.4.21.1 0.0.0.0 area 0

Rm(config)#router ospf 1
Rm(config-router)#router-id 192.4.21.10
Rm(config-router)#network 192.4.21.10 0.0.0.0 area 0
Rm(config-router)#network 192.4.11.10 0.0.0.0 area 0
Rm(config-router)#redistribute static 
% Only classful networks will be redistributed
> 왼쪽에 있는 static네트워크를 classful network로 본다.
정확히 redistribute 하고 싶으면 redistribute static subnet으로 적는다.

EIGRP======================================
Rr2(config)#router eigrp 100
Rr2(config-router)#network 192.4.23.1 0.0.0.0
Rr2(config-router)#network 192.4.22.2 0.0.0.0
Rr2(config-router)#passive-interface g0/0

Rr1(config)#router eigrp 100
Rr1(config-router)#network 192.4.22.1 0.0.0.0
Rr1(config-router)#network 192.4.21.1 0.0.0.0

Rm(config)#router eigrp 100
Rm(config-router)#network 192.4.11.10 0.0.0.0
Rm(config-router)#network 192.4.21.10 0.0.0.0
Rm(config-router)#redistribute static

Static_OSPF세팅.pkt
0.05MB
Static_EIGRP세팅.pkt
0.05MB

다음 토폴로지를 사용하여 Static routing, RIP2, OSPF, EIGRP를 각각 구현한다.

static ======================================
R1(config)# ip route 2.2.2.0 255.255.255.0 192.168.12.2

R2(config)# ip route 1.1.1.0 255.255.255.0 192.168.12.1


RIPv2 =======================================
R1(config)# router rip
R1(config-router)# version 2
R1(config-router)# no auto-summary 
R1(config-router)# network 1.1.1.0
R1(config-router)# network 192.4.12.0
R1(config-router)# passive-interface g0/0

R2(config)# router rip
R2(config-router)# version 2
R2(config-router)# no auto-summary 
R2(config-router)# network 2.2.2.0
R2(config-router)# network 192.4.12.0
R2(config-router)# passive-interface g0/0


OSPF ========================================
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 1.1.1.1 0.0.0.0 area 0
R1(config-router)# network 192.4.12.1 0.0.0.0 area 0

R2(config)# router ospf 1
R2(config-router)# router-id 2.2.2.1
R2(config-router)# network 2.2.2.1 0.0.0.0 area 0
R2(config-router)# network 192.4.12.2 0.0.0.0 area 0


EIGRP ========================================
R1(config)# router eigrp 100
R1(config-router)# network 1.1.1.1 0.0.0.0
R1(config-router)# network 192.4.12.1 0.0.0.0

R2(config)# router eigrp 100
R2(config-router)# network 2.2.2.1 0.0.0.0
R2(config-router)# network 192.4.12.2 0.0.0.0

Staic routing.pkt
0.04MB
RIP2.pkt
0.05MB
OSPF.pkt
0.05MB
EIGRP.pkt
0.05MB

OSPF 실습

OSPF 프로세스 활성화 및 Router ID 설정

R1

R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1

R2

R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.1

R3

R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.1

 

각 인터페이스를 등록한다.

R1

R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 192.168.12.1 0.0.0.0 area 0
R1(config-router)#network 192.168.31.1 0.0.0.0 area 0

R2

R2(config-router)#network 2.2.2.1 0.0.0.0 area 0
R2(config-router)#network 192.168.12.2 0.0.0.0 area 0
R2(config-router)#network 192.168.23.2 0.0.0.0 area 0

R3

R3(config-router)#network 3.3.3.1 0.0.0.0 area 0
R3(config-router)#network 192.168.31.3 0.0.0.0 area 0
R3(config-router)#network 192.168.23.3 0.0.0.0 area 0

 

OSPF 설정 확인

R1

R1#show ip protocol

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set 
  Incoming update filter list for all interfaces is not set 
  Router ID 1.1.1.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    1.1.1.1 0.0.0.0 area 0
    192.168.12.1 0.0.0.0 area 0
    192.168.31.1 0.0.0.0 area 0
  Routing Information Sources:  
    Gateway         Distance      Last Update 
    1.1.1.1              110      00:01:32
    2.2.2.1              110      00:01:32
    3.3.3.1              110      00:01:32
  Distance: (default is 110)

R2

R2#show ip protocol

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set 
  Incoming update filter list for all interfaces is not set 
  Router ID 2.2.2.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    2.2.2.1 0.0.0.0 area 0
    192.168.12.2 0.0.0.0 area 0
    192.168.23.2 0.0.0.0 area 0
  Routing Information Sources:  
    Gateway         Distance      Last Update 
    1.1.1.1              110      00:10:45
    2.2.2.1              110      00:10:46
    3.3.3.1              110      00:10:45
  Distance: (default is 110)

R3

R3#show ip protocol

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set 
  Incoming update filter list for all interfaces is not set 
  Router ID 3.3.3.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    3.3.3.1 0.0.0.0 area 0
    192.168.31.3 0.0.0.0 area 0
    192.168.23.3 0.0.0.0 area 0
  Routing Information Sources:  
    Gateway         Distance      Last Update 
    1.1.1.1              110      00:12:33
    2.2.2.1              110      00:12:33
    3.3.3.1              110      00:12:33
  Distance: (default is 110)

 

neighbor 컴퓨터 확인

R1

R1#show ip ospf neighbor


Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.1           0   FULL/  -        00:00:38    192.168.12.2    Serial0/0/0
3.3.3.1           0   FULL/  -        00:00:34    192.168.31.3    Serial0/0/1
R1#show ip ospf int s0/0/0

Serial0/0/0 is up, line protocol is up
  Internet address is 192.168.12.1/24, Area 0
  Process ID 1, Router ID 1.1.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
    Hello due in 00:00:05
  Index 2/2, 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 2.2.2.1
  Suppress hello for 0 neighbor(s)

R2

R2#show ip ospf neighbor


Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.1           0   FULL/  -        00:00:33    192.168.23.3    Serial0/0/0
1.1.1.1           0   FULL/  -        00:00:32    192.168.12.1    Serial0/0/1
R2#show ip ospf int s0/0/0

Serial0/0/0 is up, line protocol is up
  Internet address is 192.168.23.2/24, Area 0
  Process ID 1, Router ID 2.2.2.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
    Hello due in 00:00:02
  Index 3/3, 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 3.3.3.1
  Suppress hello for 0 neighbor(s)

R3

R3#show ip ospf neighbor


Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.1           0   FULL/  -        00:00:30    192.168.23.2    Serial0/0/1
1.1.1.1           0   FULL/  -        00:00:30    192.168.31.1    Serial0/0/0
R3#show ip ospf int s0/0/0

Serial0/0/0 is up, line protocol is up
  Internet address is 192.168.31.3/24, Area 0
  Process ID 1, Router ID 3.3.3.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
    Hello due in 00:00:08
  Index 2/2, 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 1.1.1.1
  Suppress hello for 0 neighbor(s)

 

OSPF에 의해 라우팅 정보 받아왔는지 확인

R1

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, 2 subnets, 2 masks
C       1.1.1.0/24 is directly connected, GigabitEthernet0/0
L       1.1.1.1/32 is directly connected, GigabitEthernet0/0
     2.0.0.0/24 is subnetted, 1 subnets
O       2.2.2.0/24 [110/65] via 192.168.12.2, 00:03:05, Serial0/0/0
     3.0.0.0/24 is subnetted, 1 subnets
O       3.3.3.0/24 [110/65] via 192.168.31.3, 00:02:25, Serial0/0/1
     192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.12.0/24 is directly connected, Serial0/0/0
L       192.168.12.1/32 is directly connected, Serial0/0/0
O    192.168.23.0/24 [110/128] via 192.168.12.2, 00:02:25, Serial0/0/0
                     [110/128] via 192.168.31.3, 00:02:25, Serial0/0/1
     192.168.31.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.31.0/24 is directly connected, Serial0/0/1
L       192.168.31.1/32 is directly connected, Serial0/0/1

R2

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 not set

     1.0.0.0/24 is subnetted, 1 subnets
O       1.1.1.0/24 [110/65] via 192.168.12.1, 00:11:16, Serial0/0/1
     2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       2.2.2.0/24 is directly connected, GigabitEthernet0/0
L       2.2.2.1/32 is directly connected, GigabitEthernet0/0
     3.0.0.0/24 is subnetted, 1 subnets
O       3.3.3.0/24 [110/65] via 192.168.23.3, 00:10:56, Serial0/0/0
     192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.12.0/24 is directly connected, Serial0/0/1
L       192.168.12.2/32 is directly connected, Serial0/0/1
     192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.23.0/24 is directly connected, Serial0/0/0
L       192.168.23.2/32 is directly connected, Serial0/0/0
O    192.168.31.0/24 [110/128] via 192.168.12.1, 00:10:56, Serial0/0/1
                     [110/128] via 192.168.23.3, 00:10:56, Serial0/0/0

R3

R3#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/24 is subnetted, 1 subnets
O       1.1.1.0/24 [110/65] via 192.168.31.1, 00:12:42, Serial0/0/0
     2.0.0.0/24 is subnetted, 1 subnets
O       2.2.2.0/24 [110/65] via 192.168.23.2, 00:12:42, Serial0/0/1
     3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       3.3.3.0/24 is directly connected, GigabitEthernet0/0
L       3.3.3.1/32 is directly connected, GigabitEthernet0/0
O    192.168.12.0/24 [110/128] via 192.168.31.1, 00:12:42, Serial0/0/0
                     [110/128] via 192.168.23.2, 00:12:42, Serial0/0/1
     192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.23.0/24 is directly connected, Serial0/0/1
L       192.168.23.3/32 is directly connected, Serial0/0/1
     192.168.31.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.31.0/24 is directly connected, Serial0/0/0
L       192.168.31.3/32 is directly connected, Serial0/0/0

 

PC에서 TEST

PC1

C:\>ping 2.2.2.11

Pinging 2.2.2.11 with 32 bytes of data:

Request timed out.
Reply from 2.2.2.11: bytes=32 time=5ms TTL=126
Reply from 2.2.2.11: bytes=32 time=3ms TTL=126
Reply from 2.2.2.11: bytes=32 time=7ms TTL=126

Ping statistics for 2.2.2.11:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 3ms, Maximum = 7ms, Average = 5ms

C:\>ping 3.3.3.11

Pinging 3.3.3.11 with 32 bytes of data:

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

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

PC2

C:\>ping 1.1.1.11

Pinging 1.1.1.11 with 32 bytes of data:

Reply from 1.1.1.11: bytes=32 time=2ms TTL=126
Reply from 1.1.1.11: bytes=32 time=6ms TTL=126
Reply from 1.1.1.11: bytes=32 time=5ms TTL=126
Reply from 1.1.1.11: bytes=32 time=5ms TTL=126

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

C:\>ping 3.3.3.11

Pinging 3.3.3.11 with 32 bytes of data:

Reply from 3.3.3.11: bytes=32 time=6ms TTL=126
Reply from 3.3.3.11: bytes=32 time=5ms TTL=126
Reply from 3.3.3.11: bytes=32 time=5ms TTL=126
Reply from 3.3.3.11: bytes=32 time=6ms TTL=126

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

PC3

C:\>ping 1.1.1.11

Pinging 1.1.1.11 with 32 bytes of data:

Reply from 1.1.1.11: bytes=32 time=6ms TTL=126
Reply from 1.1.1.11: bytes=32 time=2ms TTL=126
Reply from 1.1.1.11: bytes=32 time=6ms TTL=126
Reply from 1.1.1.11: bytes=32 time=7ms TTL=126

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

C:\>ping 2.2.2.11

Pinging 2.2.2.11 with 32 bytes of data:

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

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

OSPF.pkt
0.05MB


아래와 같이 라우터 연결을 하나 끊어도 통신이 잘 되는 것을 확인할 수 있다.

PC2

C:\>ping 1.1.1.11

Pinging 1.1.1.11 with 32 bytes of data:

Reply from 1.1.1.11: bytes=32 time=7ms TTL=126
Reply from 1.1.1.11: bytes=32 time=6ms TTL=126
Reply from 1.1.1.11: bytes=32 time=5ms TTL=126
Reply from 1.1.1.11: bytes=32 time=6ms TTL=126

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

C:\>ping 3.3.3.11

Pinging 3.3.3.11 with 32 bytes of data:

Reply from 3.3.3.11: bytes=32 time=10ms TTL=125
Reply from 3.3.3.11: bytes=32 time=8ms TTL=125
Reply from 3.3.3.11: bytes=32 time=8ms TTL=125
Reply from 3.3.3.11: bytes=32 time=7ms TTL=125

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

 

R2의 라우팅 정보는 변경되지 않는다.

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 not set

     1.0.0.0/24 is subnetted, 1 subnets
O       1.1.1.0/24 [110/65] via 192.168.12.1, 00:20:03, Serial0/0/1
     2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       2.2.2.0/24 is directly connected, GigabitEthernet0/0
L       2.2.2.1/32 is directly connected, GigabitEthernet0/0
     3.0.0.0/24 is subnetted, 1 subnets
O       3.3.3.0/24 [110/129] via 192.168.12.1, 00:03:18, Serial0/0/1
     192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.12.0/24 is directly connected, Serial0/0/1
L       192.168.12.2/32 is directly connected, Serial0/0/1
O    192.168.31.0/24 [110/128] via 192.168.12.1, 00:03:18, Serial0/0/1

OSPF  DR, BDR 실습

OSPF 인터페이스 설정

R1

R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 5.5.5.1 0.0.0.0 area 0

R2

R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.1
R2(config-router)#network 2.2.2.1 0.0.0.0 area 0
R2(config-router)#network 5.5.5.2 0.0.0.0 area 0

R3

R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.1
R3(config-router)#network 3.3.3.1 0.0.0.0 area 0
R3(config-router)#network 5.5.5.3 0.0.0.0 area 0

R4

R4(config)#router ospf 1
R4(config-router)#router-id 4.4.4.1
R4(config-router)#network 4.4.4.1 0.0.0.0 area 0
R4(config-router)#network 5.5.5.4 0.0.0.0 area 0

 

DR, BDR 확인

라우터를 킨 순서로 DR, BDR이 선정된다.

DR, BDR이 선정되면 다시 선정하는 작업은 하지 않는다.

R4#show ip ospf neighbor


Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DR         00:00:39    5.5.5.1         GigabitEthernet0/1
3.3.3.1           1   2WAY/DROTHER    00:00:30    5.5.5.3         GigabitEthernet0/1
2.2.2.1           1   FULL/BDR        00:00:33    5.5.5.2         GigabitEthernet0/1

 

DR로 선정된 R1을 끄면 DR이 변경되는 것을 확인할 수 있다.

R3#show ip ospf neighbor


Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.1           1   FULL/DR         00:00:37    5.5.5.2         GigabitEthernet0/1
4.4.4.1           1   FULL/BDR        00:00:37    5.5.5.4         GigabitEthernet0/1
1.1.1.1           1   2WAY/DROTHER    00:00:37    5.5.5.1         GigabitEthernet0/1

 

PC TEST

PC1

C:\>ping 3.3.3.11

Pinging 3.3.3.11 with 32 bytes of data:

Request timed out.
Reply from 3.3.3.11: bytes=32 time<1ms TTL=126
Reply from 3.3.3.11: bytes=32 time<1ms TTL=126
Reply from 3.3.3.11: bytes=32 time<1ms TTL=126

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

DR_BDR.pkt
0.05MB


Multi area OSPF

Router 설정

R0_1

R0_1(config)#router ospf 1
R0_1(config-router)#router-id 192.168.0.1
R0_1(config-router)#network 192.168.0.1 0.0.0.0 area 0
R0_1(config-router)#network 192.168.1.1 0.0.0.0 area 1

R0_2

R0_2(config)#router ospf 1
R0_2(config-router)#router-id 192.168.0.2
R0_2(config-router)#network 192.168.0.2 0.0.0.0 area 0
R0_2(config-router)#network 192.168.2.1 0.0.0.0 area 2

R1

R1(config)#router ospf 1
R1(config-router)#router-id 192.168.10.1
R1(config-router)#network 192.168.10.1 0.0.0.0 area 1
R1(config-router)#network 192.168.1.2 0.0.0.0 area 1

R2

R2(config)#router ospf 1
R2(config-router)#router-id 192.168.20.1
R2(config-router)#network 192.168.20.1 0.0.0.0 area 2
R2(config-router)#network 192.168.2.2 0.0.0.0 area 2

 

PC1에서 TEST

C:\>ping 192.168.20.3

Pinging 192.168.20.3 with 32 bytes of data:

Request timed out.
Reply from 192.168.20.3: bytes=32 time=59ms TTL=124
Reply from 192.168.20.3: bytes=32 time=11ms TTL=124
Reply from 192.168.20.3: bytes=32 time=10ms TTL=124

Ping statistics for 192.168.20.3:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 10ms, Maximum = 59ms, Average = 26ms

multi area ospf.pkt
0.05MB

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

신뢰적 Data 전송 : rdt 1.0  (0) 2022.01.18
Transport Layer  (0) 2022.01.18
OSPF  (0) 2022.01.18
RIP 라우팅 구현 실습  (0) 2022.01.17
동적 라우팅 및 RIP  (0) 2022.01.17

OSPF (Open Shortest Path First)

: 계층화 된 라우팅 프로토콜이다.
• IGP(Internal Gateway Protocol)
 - AS(Autonomous System)내부에 사용
• Area에 의해 효율적인 라우팅 정보 관리가 가능하다.
 - Backbone area(Area0)을 통해 연결된다.
 - Area0에 연결되지 못하면 Virtual link를 통해 연결한다.
 - Area 내에서 LSA를 교환한다.
• Link의 cost를 기반으로 경로를 배정한다.
 - Hop 제한이 없다. (라우터 개수 제한X)
 - Dijkstra의 SPF알고리즘을 바탕으로 경로가 선택된다.
 - link cost = 기준대역폭/실제대역폭
• VLSM을 지원한다.

 

OSPF - area

• ABR : Area Border Router (Area 사이에 있는 라우터 정보를 주고 받음)
• IR : Internal Router (Area 망 안에 있는 라우터)
• ASBR : Autonomous System Boundary Router (AS 망 내부와 AS망 외부를 연결) (RIP에서는 Default Gateway 역할)

OSPF - 구조

◾ 라우터의 구분
• IR : Area 내부 라우터
• ABR : Area를 연결하는 라우터
• ASBR : AS와 연결하는 외부 연결 라우터
• DR(Designated Router)
 : Link stat 정보를 취합, 관리하는 라우터
 : IR과 DR간에 link stat 정보를 주고 받는다.

 (1:1 연결 네트워크에는 없음)
• BDR(Backup DR) : 백업(DR이 죽으면 활성화)


◾ OSPF는 neighbor 간에 라우팅 정보를 공유한다.
• 라우터 간에 이런 adjacency를 위한 조건이 필요하다.
• 동일 area에 위치한다.
• 동일한 인증 정보
• 동일한 Hello interval 및 Dead interval을 가져야한다.
- 이들 값은 토플로지에 따라 자동으로 결정된다.
- 10초, 40초 : ppp, ethernet

 

◾ OSPF의 네이버(Neighbor)와 인접 관계(Adjacency)는 동일한 의미가 아니다.
• 네이버 라우터 중에 인접관계인 라우터와 LSA를 교환한다.
• 이를 통해 모든 라우터가 동일한 링크 정보를 유지한다.
• Adjancency 는 DR(BDR)과 IR간에 이뤄진다.

• DR, BDR은 인접관계

• 일반 라우터간에는 인접관계X

• 네이버 : 같은 area 안에 있는 컴퓨터

• 인접관계 : 라우팅 정보를 주고받는 것

◾ 라우팅을 위한 패킷 유형
• Hello 패킷
 - Neighbor를 맺기 위해 전송하는 정보
• DBD(Database Description)
 - 저장된 네트워크 정보에 대한 요약 정보
• LSR(Link State Request)
 - DBD를 받았을 때 가지지 못한 정보를 요청
• LSU(Link State Update)
 - LSR에 대한 응답
 - 네트워크에 대한 자세한 링크 정보
• LSAck(Link State Ack)

 

◾ OSPF LSA 송수신
• Neighbor 간에 네트워크 정보는 공유된다.
• 동기화가 마무리 되면 변경된 정보만 전달된다.
• 30분마다 정보를 확인한다.
• Area 내에 라우터 간에 링크 정보는 LSA(Link State Advertisement)로 전달한다.

OSPF 설정

1) OSPF 라우팅 프로세스 활성화
2) Router ID
 • Router ID는 OSPF를 사용하는 Router를 식별하기 위한 식별정보이다.
 • 인터페이스 IP중 가장 높은 IP가 ID로 사용된다.
 • Router ID가 인터페이스의 상태에 따라 달라지는 것을 방지한다.
   - router-id 명령으로 id를 지정한다.
   - local loopback 인터페이스에 IP를 할당한다.
 • 반드시 필요한 과정은 아니다.
3) 각 인터페이스의 네트워크 등록
4) OSPF 작동 확인

 

◾ OSPF 프로세스 활성화
• 프로세스 ID에 대한 제약은 거의 없다.
• 관리자의 정책에 따라 결정한다.
• 명령
 router ospf [process‐id]
ex) router ospf 1

 

◾ OSPF 확인 명령
• show ip ospf neighbor
  - OSPF 네이버를 확인한다.
• show ip ospf
  - OSPF 프로세서에 대한 정보를 확인한다.
• show ip ospf interface
  - OSPF에 참여하는 인터페이스의 자세한 상태정보를 확인한다.
• show ip ospf database
  - OSPF 링크 상태 데이터베이스를 열람한다.
  - LSA의 요약정보를 보여주지만 실제 링크 상태는 알 수 없다.
• show ip ospf database [추가]
  - router, network, summary ......

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

Transport Layer  (0) 2022.01.18
OSPF 실습  (0) 2022.01.18
RIP 라우팅 구현 실습  (0) 2022.01.17
동적 라우팅 및 RIP  (0) 2022.01.17
정적 라우팅 구현 실습 (라우팅 정보 입력 및 Default 라우팅)  (0) 2022.01.14

+ Recent posts