관리 메뉴

개발 노트

4/13 7주차 OSPF 본문

학부 공부 : 21.03.02~06.20/인터넷 이론 및 실습

4/13 7주차 OSPF

hayoung.dev 2021. 4. 20. 04:53

backbone

 

C는 직접 연결이 되어 있음

O는 라우팅테이블을 주고 받음

 

 

 

 

R1

Switch>enable
Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname R1
R1(config)#ip routing
R1(config)#int
R1(config)#interface Gi
R1(config)#interface GigabitEthernet 1/0/1
R1(config-if)#nos swi
R1(config-if)#no swi
R1(config-if)#no switchport 
R1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

R1(config-if)#ip address 200.16.4.1 255.255.255.0
R1(config-if)#interface GigabitEthernet 1/0/2
R1(config-if)#no switchport 
R1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to up

R1(config-if)#ip address 200.16.1.2 255.255.255.0
R1(config-if)#exit
R1(config)#router ospf 1
R1(config-router)#redistribute rip subnets
R1(config-router)#network 200.16.1.0 0.0.0.255 area 0
R1(config-router)#exit
R1(config)#router rip
R1(config-router)#network 200.16.4.0
R1(config-router)#^Z
R1#
%SYS-5-CONFIG_I: Configured from console by console

R1#write memory
Building configuration...
Compressed configuration from 7383 bytes to 3601 bytes[OK]
[OK]

 

R2

Switch>enable
Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname R2
R2(config)#ip routing
R2(config)#i
R2(config)#in
R2(config)#interface G
R2(config)#interface GigabitEthernet 1/0/1
R2(config-if)#no swi
R2(config-if)#no switchport 
R2(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

R2(config-if)#ip address 200.16.1.1 255.255.255.0
R2(config-if)#interface GigabitEthernet 1/0/2
R2(config-if)#no switchport 
R2(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to up

R2(config-if)#ip address 200.16.2.1 255.255.255.0
R2(config-if)#exit
R2(config)#router ospf 1
R2(config-router)#network 200.16.2.0 0.0.0.255 area 1
R2(config-router)#network 200.16.2.0 0.0.0.255 area 0
R2(config-router)#
00:07:19: %OSPF-6-AREACHG: 200.16.2.0/0 changed from area 1 to area 0

R2(config-router)#^Z
R2#
%SYS-5-CONFIG_I: Configured from console by console

R2#write memory
Building configuration...
Compressed configuration from 7383 bytes to 3601 bytes[OK]
[OK]

 

R3

Switch>enable
Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname R3
R3(config)#ip routing
R3(config)#int
R3(config)#interface Gi
R3(config)#interface GigabitEthernet 1/0/1
R3(config-if)#no swi
R3(config-if)#no switchport 
R3(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

R3(config-if)#ip address 200.16.3.1 255.255.255.0
R3(config-if)#interface GigabitEthernet 1/0/2
R3(config-if)#no switchport 
R3(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/2, changed state to up

R3(config-if)#ip address 200.16.2.2 255.255.255.0
R3(config-if)#exit
R3(config)#router ospf 1
R3(config-router)#network 200.16.2.0 0.0.0.255 area 1
R3(config-router)#network 200.16.3.0 0
                                     ^
% Invalid input detected at '^' marker.
	
R3(config-router)#
00:07:44: %OSPF-5-ADJCHG: Process 1, Nbr 200.16.2.1 on GigabitEthernet1/0/2 from LOADING to FULL, Loading Done

R3(config-router)#^Z
R3#
%SYS-5-CONFIG_I: Configured from console by console

R3#write memory
Building configuration...
Compressed configuration from 7383 bytes to 3601 bytes[OK]
[OK]

 

 

area 1 stub을 하면 o가 사라짐

R3#config t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#router ospf 1
R3(config-router)#area 1 stub
R3(config-router)#
00:10:49: %OSPF-5-ADJCHG: Process 1, Nbr 200.16.2.1 on GigabitEthernet1/0/2 from FULL to DOWN, Neighbor Down: Adjacency forced to reset

00:10:49: %OSPF-5-ADJCHG: Process 1, Nbr 200.16.2.1 on GigabitEthernet1/0/2 from FULL to DOWN, Neighbor Down: Interface down or detached

R3(config-router)#
00:10:54: %OSPF-5-ADJCHG: Process 1, Nbr 200.16.2.1 on GigabitEthernet1/0/2 from LOADING to FULL, Loading Done
^Z
R3#
%SYS-5-CONFIG_I: Configured from console by console

R3#show ip route
Codes: C - connected, S - static, I - IGRP, 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

C    200.16.2.0/24 is directly connected, GigabitEthernet1/0/2
C    200.16.3.0/24 is directly connected, GigabitEthernet1/0/1

 

 

R2에서 area 1 stub no-summary를 하면

R2#config t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#router ospf 1
R2(config-router)#area 1 stub no-summary
R2(config-router)#^Z
R2#
%SYS-5-CONFIG_I: Configured from console by console

R2#write memory
Building configuration...
Compressed configuration from 7383 bytes to 3601 bytes[OK]
[OK]

R3에 사라졌던 O가 다시 보인다.

R3#show ip route
Codes: C - connected, S - static, I - IGRP, 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 200.16.2.1 to network 0.0.0.0

C    200.16.2.0/24 is directly connected, GigabitEthernet1/0/2
C    200.16.3.0/24 is directly connected, GigabitEthernet1/0/1
O*IA 0.0.0.0/0 [110/2] via 200.16.2.1, 00:02:06, GigabitEthernet1/0/2
반응형