[OSPF 설정] 라우터 컨피그 예제 : Hub Router + Spoke Router (STUB) + Local Internet Spoke Router (NSSA + ASBR)

 ! ===== Hub Router (ABR) =====

hostname HUB-RTR1

!

interface Tunnel101

 ip address 10.101.0.1 255.255.255.252

 ip ospf network point-to-point

 tunnel source <HUB_WAN_IP>

 tunnel destination <SITE101_WAN_IP>

! (GRE over IPsec/VTI 환경이면 이에 맞게 구성)

!

interface Tunnel120

 ip address 10.120.0.1 255.255.255.252

 ip ospf network point-to-point

 tunnel source <HUB_WAN_IP>

 tunnel destination <SITE120_WAN_IP>

!

interface Loopback0

 ip address 1.1.1.1 255.255.255.255

!

router ospf 100

 router-id 1.1.1.1


 ! --- 백본(사내 코어 측) ---

 network 172.16.0.0 0.0.255.255 area 0


 ! --- 일반 스포크(Stub 또는 Totally-Stub) ---

 ! ABR 쪽에만 'no-summary'를 넣으면 "Totally-Stub"가 되어

 ! Type-3 요약도 막고 0/0만 내려보냅니다. (스포크에서는 'area 101 stub'만)

 area 101 stub no-summary

 network 10.101.0.0 0.0.0.3 area 101


 ! --- 로컬 인터넷 스포크(NSSA) ---

 ! NSSA에서 외부(7번) LSA가 백본으로 번지는 걸 막고 싶으면 'no-redistribution'

 ! (정책에 따라 선택)

 area 120 nssa no-redistribution

 ! NSSA에도 허브의 디폴트를 주고 싶으면(백업 경로):

 ! area 120 nssa default-information-originate

 network 10.120.0.0 0.0.0.3 area 120


 ! --- 요약(Optional): 각 스포크 프리픽스 묶어 Area 0으로 요약 ---

 ! area 101 range 10.101.0.0 255.255.252.0

 ! area 120 range 10.120.0.0 255.255.255.248


==========================================

==========================================

==========================================

! ===== Remote Site (Stub) =====

hostname SITE101-RTR

!

interface Tunnel101

 ip address 10.101.0.2 255.255.255.252

 ip ospf network point-to-point

 tunnel source <SITE101_WAN_IP>

 tunnel destination <HUB_WAN_IP>

!

interface Vlan10

 ip address 192.168.101.1 255.255.255.0

!

interface Loopback0

 ip address 101.101.101.101 255.255.255.255

!

router ospf 100

 router-id 101.101.101.101

 passive-interface default

 no passive-interface Tunnel101


 ! Stub 선언(스포크는 'stub'만; ABR는 'stub no-summary'면 Totally-Stub)

 area 101 stub


 ! 터널/루프백/사내망 광고

 network 10.101.0.0 0.0.0.3 area 101

 network 192.168.101.0 0.0.0.255 area 101

 network 101.101.101.101 0.0.0.0 area 101



==============================

==============================

==============================

! ===== Remote Site with Local Internet (NSSA + ASBR) =====

hostname SITE120-RTR

!

interface Tunnel120

 ip address 10.120.0.2 255.255.255.252

 ip ospf network point-to-point

 tunnel source <SITE120_WAN_IP>

 tunnel destination <HUB_WAN_IP>

!

interface Vlan20

 ip address 192.168.120.1 255.255.255.0

!

interface Loopback0

 ip address 120.120.120.120 255.255.255.255

!

! 로컬 인터넷 회선 예시

interface GigabitEthernet0/0

 description Internet_Uplink

 ip address <PUBLIC_IP> <MASK>

! default static (ISP로)

ip route 0.0.0.0 0.0.0.0 <ISP_NEXT_HOP>


router ospf 100

 router-id 120.120.120.120

 passive-interface default

 no passive-interface Tunnel120


 ! NSSA 선언(ABR도 동일 Area를 NSSA로 마킹)

 area 120 nssa


 ! 내부망/터널 광고

 network 10.120.0.0 0.0.0.3 area 120

 network 192.168.120.0 0.0.0.255 area 120

 network 120.120.120.120 0.0.0.0 area 120


 ! 이 사이트는 ASBR: 외부경로 재분배 (예: default 또는 특정 prefix)

 redistribute static subnets

!  - default만 내보내고 싶으면 'ip route 0.0.0.0/0'만 두고 redistribute static

!  - 특정 SaaS/고객망 등만 내보내려면 해당 static/connected만 두고 redistribute


! (선택) 이 NSSA 내부에서도 허브를 백업 디폴트로 보려면:

!  - 허브 ABR에 'area 120 nssa default-information-originate'


Popular posts from this blog

SSL 인증서란? 🚨 "당신의 웹사이트, 해커에게 무방비 노출?" SSL 인증서(certificate) 없으면 위험합니다! 🔒

🚀 BGP (Border Gateway Protocol)란? 인터넷을 움직이는 보이지 않는 손! 🌍✨

[OSPF 설정] Stub Area에서 디폴트 설정