본문 바로가기
네트워크 수업

23.04.13 OSPF

by 6^6 2023. 4. 13.
728x90

저번시간 이어서 : 2023.04.11 - [네트워크 수업] - [실습] OSPF 23.04.11

 

교재 : 2023.04.11 - [네트워크 수업] - OSPF.pdf 23.04.11

 

 

R1(config)#router ospf 11
R1(config-router)#no area 12 stub

 

R2(config)#router ospf 11
R2(config-router)#no area 12 stub no-summary

R2(config-router)#no area 12 stub

 

R3(config)#router ospf 11
R3(config-router)#no area 34 nssa default-information-originate 

 

R4(config)#router ospf 11
R4(config-router)#no area 34 nssa 

 

 

 

R1#clear ip ospf process 
Reset ALL OSPF processes? [no]: y

 

eigrp 의 핵심은 gear

ospf의 핵심은 stub area 축약이다.

 

 

R4(config)#router ospf 11
R4(config-router)#redistribute connected subnets

 

R2의 loo5이 재분배되었다. 그럼 R1에서는 어떻게 보일까?

 

 

1. Nomal Stub

R1) area 12 stub

R2) area 12 stub

- LSA type 5(O E1, O E2)를 차단하고 stub장비에게 default route 를 준다.

 

 

 

1. Nomal Stub

R1(config)#router ospf 11
R1(config-router)#area 12 stub

 

R2(config-router)#router ospf 11
R2(config-router)#area 12 stub

 

이렇게 주고

R1#show ip route
     11.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
C       11.11.1.0/24 is directly connected, Loopback0
O       11.11.2.0/24 [110/65] via 11.11.12.2, 00:00:11, Serial1/0
O IA    11.11.3.0/24 [110/129] via 11.11.12.2, 00:00:11, Serial1/0
C       11.11.12.0/24 is directly connected, Serial1/0
O IA    11.11.23.3/32 [110/128] via 11.11.12.2, 00:00:11, Serial1/0
O IA    11.11.23.2/32 [110/64] via 11.11.12.2, 00:00:11, Serial1/0
O IA    11.11.34.0/24 [110/192] via 11.11.12.2, 00:00:13, Serial1/0
O*IA 0.0.0.0/0 [110/65] via 11.11.12.2, 00:00:13, Serial1/0

type5만 사라졌다. 하지만 default route가 있기 때문에 통신이 된다.

 

 

 


2. Totally stub

R1) area 12 stub

R2) area 12 stub no-summary

- LSA type 3과 5(OIA, O E1, O E2)를 차단하고 stub장비에게 default route 를 준다.

 

 

2. Totally stub

R2(config)#router ospf 11
R2(config-router)#area 12 stub no-summary 

 

R1#clear ip route *

R1#show ip route
Gateway of last resort is 11.11.12.2 to network 0.0.0.0

     11.0.0.0/24 is subnetted, 3 subnets
C       11.11.1.0 is directly connected, Loopback0
O       11.11.2.0 [110/65] via 11.11.12.2, 00:01:52, Serial1/0
C       11.11.12.0 is directly connected, Serial1/0
O*IA 0.0.0.0/0 [110/65] via 11.11.12.2, 00:00:21, Serial1/0


3. Normal NSSA 

R3) area 34 nssa default-information-originate

R4) area 34 nssa

- LSA type 5 를 차단하고 stub 장비에게 디폴트 루트를 준다. 대신에 차단한 LSA type  5는 N경로(type 7)로 변형되어 stub 장비에게 건너간다. 

 

 

R3(config-if)#ip add 3.3.0.1 255.255.255.0
R3(config-if)#ip add 3.3.1.1 255.255.255.0 sec
R3(config-if)#ip add 3.3.2.1 255.255.255.0 sec
R3(config-if)#ip add 3.3.3.1 255.255.255.0 sec

R3(config)#route-map LO3
R3(config-route-map)#match interface loopback 3 
R3(config-route-map)#router ospf 11
R3(config-router)#redistribute connect route-map LO3 subnets

 

//R3(config-router)#router ospf 11
R3(config-router)#no area 34 nssa
R3(config-router)#end// 저번시간에 한거 지워주기 

 

 

R4#sho ip route
     3.0.0.0/24 is subnetted, 4 subnets
O E2    3.3.0.0 [110/20] via 11.11.34.3, 00:00:13, Serial1/0.34
O E2    3.3.1.0 [110/20] via 11.11.34.3, 00:00:13, Serial1/0.34
O E2    3.3.2.0 [110/20] via 11.11.34.3, 00:00:13, Serial1/0.34
O E2    3.3.3.0 [110/20] via 11.11.34.3, 00:00:13, Serial1/0.34
     5.0.0.0/24 is subnetted, 4 subnets
O E2    5.5.0.0 [110/20] via 11.11.34.3, 00:00:13, Serial1/0.34
O E2    5.5.1.0 [110/20] via 11.11.34.3, 00:00:13, Serial1/0.34
O E2    5.5.2.0 [110/20] via 11.11.34.3, 00:00:14, Serial1/0.34
O E2    5.5.3.0 [110/20] via 11.11.34.3, 00:00:14, Serial1/0.34
     9.0.0.0/24 is subnetted, 4 subnets
C       9.9.0.0 is directly connected, Loopback9
C       9.9.1.0 is directly connected, Loopback9
C       9.9.2.0 is directly connected, Loopback9
C       9.9.3.0 is directly connected, Loopback9
     11.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O IA    11.11.1.0/24 [110/193] via 11.11.34.3, 00:00:16, Serial1/0.34
O IA    11.11.2.0/24 [110/129] via 11.11.34.3, 00:00:16, Serial1/0.34
O       11.11.3.0/24 [110/65] via 11.11.34.3, 00:00:16, Serial1/0.34
C       11.11.4.0/24 is directly connected, Loopback0
O IA    11.11.12.0/24 [110/192] via 11.11.34.3, 00:00:16, Serial1/0.34
O IA    11.11.23.3/32 [110/64] via 11.11.34.3, 00:00:16, Serial1/0.34
O IA    11.11.23.2/32 [110/128] via 11.11.34.3, 00:00:16, Serial1/0.34
C       11.11.34.0/24 is directly connected, Serial1/0.34

 

 

R3(config)#router ospf 11
R3(config-router)#area 34 nssa default-information-originate

 

R4(config)#router ospf 11
R4(config-router)#area 34 nssa 

 

R4(config-router)#do sh ip route
Gateway of last resort is 11.11.34.3 to network 0.0.0.0

     3.0.0.0/24 is subnetted, 4 subnets
O N2    3.3.0.0 [110/20] via 11.11.34.3, 00:00:02, Serial1/0.34
O N2    3.3.1.0 [110/20] via 11.11.34.3, 00:00:02, Serial1/0.34
O N2    3.3.2.0 [110/20] via 11.11.34.3, 00:00:02, Serial1/0.34
O N2    3.3.3.0 [110/20] via 11.11.34.3, 00:00:02, Serial1/0.34
     9.0.0.0/24 is subnetted, 4 subnets
C       9.9.0.0 is directly connected, Loopback9
C       9.9.1.0 is directly connected, Loopback9
C       9.9.2.0 is directly connected, Loopback9
C       9.9.3.0 is directly connected, Loopback9
     11.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O IA    11.11.1.0/24 [110/193] via 11.11.34.3, 00:00:04, Serial1/0.34
O IA    11.11.2.0/24 [110/129] via 11.11.34.3, 00:00:04, Serial1/0.34
O       11.11.3.0/24 [110/65] via 11.11.34.3, 00:00:06, Serial1/0.34
C       11.11.4.0/24 is directly connected, Loopback0
O IA    11.11.12.0/24 [110/192] via 11.11.34.3, 00:00:06, Serial1/0.34
O IA    11.11.23.3/32 [110/64] via 11.11.34.3, 00:00:06, Serial1/0.34
O IA    11.11.23.2/32 [110/128] via 11.11.34.3, 00:00:06, Serial1/0.34
C       11.11.34.0/24 is directly connected, Serial1/0.34
O*N2 0.0.0.0/0 [110/1] via 11.11.34.3, 00:00:06, Serial1/0.34  //이렇게 디폴트 경로가 생긴다.

 

3network는 OE1, OE2가 없어야 하는데 R3에서 건너가면 안되는데 막을수가 없다. NSAstub한테는 OE1 OE2를 못막는다.  ==>type7 (stub같지않은 stub에게 어쩔수 없이 간 경우 = N2경로)

 

R3(config-router)#do sh ip route
   3.0.0.0/24 is subnetted, 4 subnets
C       3.3.0.0 is directly connected, Loopback3
C       3.3.1.0 is directly connected, Loopback3
C       3.3.2.0 is directly connected, Loopback3
C       3.3.3.0 is directly connected, Loopback3
     5.0.0.0/24 is subnetted, 4 subnets
O E2    5.5.0.0 [110/20] via 11.11.23.2, 00:02:27, Serial1/0.23
O E2    5.5.1.0 [110/20] via 11.11.23.2, 00:02:27, Serial1/0.23
O E2    5.5.2.0 [110/20] via 11.11.23.2, 00:02:27, Serial1/0.23
O E2    5.5.3.0 [110/20] via 11.11.23.2, 00:02:28, Serial1/0.23
     9.0.0.0/24 is subnetted, 4 subnets
O N2    9.9.0.0 [110/20] via 11.11.34.4, 00:01:34, Serial1/0.34
O N2    9.9.1.0 [110/20] via 11.11.34.4, 00:01:34, Serial1/0.34
O N2    9.9.2.0 [110/20] via 11.11.34.4, 00:01:35, Serial1/0.34   //R3,R4 서로 N2 경로로 건너온다는 것을 알수있다.
O N2    9.9.3.0 [110/20] via 11.11.34.4, 00:01:35, Serial1/0.34
     11.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O IA    11.11.1.0/24 [110/129] via 11.11.23.2, 00:02:30, Serial1/0.23
O IA    11.11.2.0/24 [110/65] via 11.11.23.2, 00:02:30, Serial1/0.23
C       11.11.3.0/24 is directly connected, Loopback0
O       11.11.4.0/24 [110/65] via 11.11.34.4, 00:01:35, Serial1/0.34
O IA    11.11.12.0/24 [110/128] via 11.11.23.2, 00:02:30, Serial1/0.23
O       11.11.23.2/32 [110/64] via 11.11.23.2, 00:02:30, Serial1/0.23
C       11.11.23.0/24 is directly connected, Serial1/0.23
C       11.11.34.0/24 is directly connected, Serial1/0.34

 


4. Totally NSSA

R3) area 34 nssa no-summary

R4) area 34 nsss

-LSA type 3과 5를 차단하고 stub장비에게 디폴트 루트를 준다. 대신에 차단한 LSA type 5는  N경로(type7)로 변형되어 stub에게 건너간다.

 

서로 주고받은 N경로를 지우고싶다면?

 

R3(config)#router ospf 11

R3(config-router)#no area 34 nssa no-summary default
R3(config-router)#no area 34 nssa
R3(config-router)#area 34 nssa no-summary

show run>>

router ospf 11
 router-id 11.11.3.3
 log-adjacency-changes
 area 34 nssa no-summary
 redistribute connected subnets route-map LO3
 network 11.11.3.3 0.0.0.0 area 34
 network 11.11.23.3 0.0.0.0 area 0
 network 11.11.34.3 0.0.0.0 area 34

 

R3#clear ip ospf process
Reset ALL OSPF processes? [no]: y

 

R4#clear ip route *

R4#show ip route
Gateway of last resort is 11.11.34.3 to network 0.0.0.0

     3.0.0.0/24 is subnetted, 4 subnets
N2    3.3.0.0 [110/20] via 11.11.34.3, 00:00:15, Serial1/0.34
O N2    3.3.1.0 [110/20] via 11.11.34.3, 00:00:15, Serial1/0.34
O N2    3.3.2.0 [110/20] via 11.11.34.3, 00:00:15, Serial1/0.34
N2    3.3.3.0 [110/20] via 11.11.34.3, 00:00:15, Serial1/0.34 //이래도 R3은 N경로로 넘어왔다.     9.0.0.0/24 is subnetted, 4 subnets
C       9.9.0.0 is directly connected, Loopback9
C       9.9.1.0 is directly connected, Loopback9
C       9.9.2.0 is directly connected, Loopback9
C       9.9.3.0 is directly connected, Loopback9
     11.0.0.0/24 is subnetted, 3 subnets
O       11.11.3.0 [110/65] via 11.11.34.3, 00:00:17, Serial1/0.34
C       11.11.4.0 is directly connected, Loopback0
C       11.11.34.0 is directly connected, Serial1/0.34
O*IA 0.0.0.0/0 [110/65] via 11.11.34.3, 00:00:18, Serial1/0.34

 

 

R3#show ip route
     3.0.0.0/24 is subnetted, 4 subnets
C       3.3.0.0 is directly connected, Loopback3
C       3.3.1.0 is directly connected, Loopback3
C       3.3.2.0 is directly connected, Loopback3
C       3.3.3.0 is directly connected, Loopback3
     5.0.0.0/24 is subnetted, 4 subnets
O E2    5.5.0.0 [110/20] via 11.11.23.2, 00:01:30, Serial1/0.23
O E2    5.5.1.0 [110/20] via 11.11.23.2, 00:01:30, Serial1/0.23
O E2    5.5.2.0 [110/20] via 11.11.23.2, 00:01:30, Serial1/0.23
O E2    5.5.3.0 [110/20] via 11.11.23.2, 00:01:32, Serial1/0.23
     9.0.0.0/24 is subnetted, 4 subnets
N2    9.9.0.0 [110/20] via 11.11.34.4, 00:01:22, Serial1/0.34
N2    9.9.1.0 [110/20] via 11.11.34.4, 00:01:22, Serial1/0.34
N2    9.9.2.0 [110/20] via 11.11.34.4, 00:01:23, Serial1/0.34
N2    9.9.3.0 [110/20] via 11.11.34.4, 00:01:23, Serial1/0.34  //얘도변함없이N경로로 넘어왔다.
     11.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O IA    11.11.1.0/24 [110/129] via 11.11.23.2, 00:01:33, Serial1/0.23
O IA    11.11.2.0/24 [110/65] via 11.11.23.2, 00:01:33, Serial1/0.23
C       11.11.3.0/24 is directly connected, Loopback0
O       11.11.4.0/24 [110/65] via 11.11.34.4, 00:01:23, Serial1/0.34
O IA    11.11.12.0/24 [110/128] via 11.11.23.2, 00:01:33, Serial1/0.23
O       11.11.23.2/32 [110/64] via 11.11.23.2, 00:01:33, Serial1/0.23
C       11.11.23.0/24 is directly connected, Serial1/0.23
C       11.11.34.0/24 is directly connected, Serial1/0.34

 

R3이렇게만 보이게.

router ospf 11
 router-id 11.11.3.3
 log-adjacency-changes
 area 34 nssa no-summary
 redistribute connected subnets route-map LO3
 network 11.11.3.3 0.0.0.0 area 34
 network 11.11.23.3 0.0.0.0 area 0
 network 11.11.34.3 0.0.0.0 area 34

 

     3.0.0.0/24 is subnetted, 4 subnets
C       3.3.0.0 is directly connected, Loopback3
C       3.3.1.0 is directly connected, Loopback3
C       3.3.2.0 is directly connected, Loopback3
C       3.3.3.0 is directly connected, Loopback3
     5.0.0.0/24 is subnetted, 4 subnets
O E2    5.5.0.0 [110/20] via 11.11.23.2, 00:00:12, Serial1/0.23
O E2    5.5.1.0 [110/20] via 11.11.23.2, 00:00:12, Serial1/0.23
O E2    5.5.2.0 [110/20] via 11.11.23.2, 00:00:12, Serial1/0.23
O E2    5.5.3.0 [110/20] via 11.11.23.2, 00:00:14, Serial1/0.23
     9.0.0.0/24 is subnetted, 4 subnets
O N2    9.9.0.0 [110/20] via 11.11.34.4, 00:00:14, Serial1/0.34
O N2    9.9.1.0 [110/20] via 11.11.34.4, 00:00:14, Serial1/0.34
O N2    9.9.2.0 [110/20] via 11.11.34.4, 00:00:15, Serial1/0.34
O N2    9.9.3.0 [110/20] via 11.11.34.4, 00:00:15, Serial1/0.34
     11.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O IA    11.11.1.0/24 [110/129] via 11.11.23.2, 00:00:15, Serial1/0.23
O IA    11.11.2.0/24 [110/65] via 11.11.23.2, 00:00:15, Serial1/0.23
C       11.11.3.0/24 is directly connected, Loopback0
O       11.11.4.0/24 [110/65] via 11.11.34.4, 00:00:15, Serial1/0.34
O IA    11.11.12.0/24 [110/128] via 11.11.23.2, 00:00:15, Serial1/0.23
O       11.11.23.2/32 [110/64] via 11.11.23.2, 00:00:15, Serial1/0.23
C       11.11.23.0/24 is directly connected, Serial1/0.23
C       11.11.34.0/24 is directly connected, Serial1/0.34

 

 

이렇게 해주고

R3(config-router)#area 34 nssa no-summary no-redistribution

 

 

R4#show ip route
     9.0.0.0/24 is subnetted, 4 subnets
C       9.9.0.0 is directly connected, Loopback9
C       9.9.1.0 is directly connected, Loopback9
C       9.9.2.0 is directly connected, Loopback9
C       9.9.3.0 is directly connected, Loopback9
     11.0.0.0/24 is subnetted, 3 subnets
O       11.11.3.0 [110/65] via 11.11.34.3, 00:00:01, Serial1/0.34
C       11.11.4.0 is directly connected, Loopback0
C       11.11.34.0 is directly connected, Serial1/0.34
O*IA 0.0.0.0/0 [110/65] via 11.11.34.3, 00:00:03, Serial1/0.34

//N경로가 사라졌다.

여기서 재분배한건 어쩔수없이 넘어간다.

 

 


5. Totally NSSA no-redistribute

-LSA type 3,5,7을 차단하고 stub장비에게 디폴트 루트를 준다. 그러나 stub 장비에서 재분배된 외부네트워크는 ABR인 R3으로 N경로로 건너온다. 

R3) area 34 nssa no-summary no-redi

R4) area 34 nsss

728x90

'네트워크 수업' 카테고리의 다른 글

23.04.14 OSPF CCIE 코드 정리  (0) 2023.04.14
[네트워크] OSPF / Frame-Relay 23.04.13  (0) 2023.04.13
[실습] OSPF 23.04.11  (0) 2023.04.11
[실습] OSPF, EIGRP 23.04.06  (0) 2023.04.06
OSPF 23.04.04  (0) 2023.04.04

댓글