09Route Aggregation과 Routing PolicyRoute Aggregation과 Routing Policy
동적 라우팅을 운영하려면 어떤 경로를 하나로 묶고, 무엇을 받아들이고(import), 무엇을 알릴지(export), 그 속성을 어떻게 바꿀지 를 세밀하게 제어해야 합니다. Check Point Gaia는 이를 위해 크게 두 갈래의 도구를 제공합니다. 하나는 여러 경로를 하나의 요약 경로로 합치는 Route Aggregation(경로 집약) 이고, 다른 하나는 경로의 수용·광고·재분배·필터링·속성 변경을 규칙으로 정하는 Routing Policy(라우팅 정책) 입니다. 이 장은 두 기능을 Gaia Portal과 Gaia Clish 양쪽에서 어떻게 구성하는지, 모든 파라미터와 매칭 방식, 명령 구문, 예제까지 빠짐없이 풀어 정리합니다. 분량이 매우 많으므로, Route Aggregation → Inbound Route Filters → Route Redistribution → Route Maps → Prefix List/Tree 순서로 읽으면 흐름이 자연스럽습니다.
---
Route Aggregation — 여러 경로를 하나로 묶기
Route Aggregation(경로 집약) 은 좀 더 구체적인(more specific) 여러 경로를 하나의 더 일반적인(more general) 경로로 합치는 기능입니다. 이렇게 하면 특정 프로토콜이 광고하는 경로의 개수가 줄어들어 라우팅 테이블이 단순해지고 광고 트래픽이 가벼워집니다.
대표적인 예를 들어 보겠습니다.
- 어떤 라우터가 Class C 네트워크에서 서브넷팅된 stub 인터페이스 경로를 여러 개 가지고 있습니다.
- 그 라우터가 다른 인터페이스에서는 RIPv2 를 돌리고 있습니다.
- 이때 그 여러 인터페이스 경로를 하나의 집약 경로(예: Class C 네트워크 하나)로 합칠 수 있습니다.
- 그러면 개별 경로의 긴 목록 대신 이 하나의 집약 경로만 RIPv2로 재분배 하면 됩니다.
집약 경로를 다룰 때 반드시 알아야 할 동작이 몇 가지 있습니다.
- 집약 경로를 만들어 내보내는(originate) 인터페이스 자체는 그 집약 경로로 패킷을 전달하지 않습니다. 집약 경로를 실제로 사용하는 쪽은 그 경로를 받은(receive) 라우터 입니다.
- 집약 경로를 받은 라우터가 구성 경로(component route) 중 어디에도 맞지 않는 패킷 을 받으면, ICMP "Network Unreachable" 메시지로 응답해야 합니다. 이렇게 해야 알 수 없는 하위 경로로 향하는 패킷이 기본 경로(default route)를 타고 다른 네트워크로 흘러 들어가는 것을 막을 수 있습니다. 그렇지 않으면 그런 패킷은 TTL이 만료될 때까지 경계 라우터로 계속 되돌려 보내질 수 있습니다.
집약 경로를 만드는 순서는 일정합니다. 먼저 네트워크 주소와 서브넷 마스크 를 지정하고, 이어서 그 집약을 이루는 기여 경로(contributing routes)의 집합 을 정의합니다. 기여 경로는 출처(소스) — 라우팅 프로토콜이나 정적 경로 — 를 지정한 뒤 경로 필터를 붙여 정의하는데, 경로 필터는 prefix이거나 키워드 "all IPv4 routes"입니다. 하나의 집약 경로는 기여 경로를 여러 개 가질 수 있습니다. 다만 최소한 하나의 기여 경로가 이미 존재해야 집약 경로가 생성(활성화)된다는 점을 기억해야 합니다.
Gaia Portal에서 IPv4 집약 경로 추가하기
Gaia Portal에서는 다음 순서로 IPv4 집약 경로를 만듭니다.
- 왼쪽 탐색 트리에서 Advanced Routing > Route Aggregation 을 클릭합니다.
- Route Aggregation 섹션에서 Add 를 누르고 IPv4 를 선택합니다.
- IPv4 address 필드에 새 기여 경로의 IPv4 주소를 입력합니다.
- Subnet mask 필드에 새 기여 경로의 IPv4 서브넷 마스크를 입력합니다.
- Rank 필드에 새 기여 경로의 rank를 입력합니다.
- Weight 필드에 새 기여 경로의 weight를 입력합니다.
- AS Path Truncate 옵션으로 AS(Autonomous System) path 절단 모드를 정합니다.
- Contributing Routes 섹션에서 Add 를 누릅니다.
- Protocol 필드에서 집약 경로에 포함할 경로를 내놓는 기여 프로토콜을 선택합니다.
- Contribute All IPv4 Routes 옵션으로, 그 프로토콜이 내놓는 어떤 경로라도 집약 경로를 활성화하도록 허용할지를 정합니다.
- IPv4 address 필드에 그 프로토콜이 집약 경로에 기여하는 경로의 IPv4 주소를 입력합니다.
- Subnet mask 필드에 그 기여 경로의 IPv4 서브넷 마스크를 입력합니다.
- Match Type 옵션으로 경로를 어떻게 매칭할지를 정합니다.
- OK 를 클릭합니다.
- Save 를 클릭합니다.
각 필드가 무엇을 뜻하고 어떤 값을 받는지는 아래 표에 정리했습니다.
| 필드 | 설명 | 범위 / 기본값 |
|---|---|---|
| IPv4 address (집약 경로) | 프로토콜이 기여하면 이 집약 경로를 활성화합니다. IPv4 주소와 서브넷 마스크는 하나의 라우팅 테이블 항목 에 대응합니다. | Dotted-quad [0-255].[0-255].[0-255].[0-255] / 기본값 없음 |
| Subnet mask (집약 경로) | 위와 동일. 프로토콜이 기여하면 집약 경로를 활성화합니다. | Dotted-quad / 기본값 없음 |
| Rank | 서로 다른 프로토콜이 같은 목적지로 가는 경로를 가질 때 라우팅 시스템이 사용하는 우선순위입니다. 각 경로에 대해 rank가 가장 낮은(lowest) 프로토콜의 경로가 선택 됩니다(자세한 내용은 "Protocol Rank" 참고). | 0–255 / 기본값 130 |
| Weight | rank 다음의 두 번째 동점 결정자(tie breaker) 입니다. 같은 목적지로 가는 경로 중 weight가 가장 높은(highest) 경로가 active 경로가 되어 커널 포워딩 테이블에 설치되고 다른 프로토콜로 재분배됩니다. | 0–65535 / 기본값 0 |
| AS Path Truncate | 활성화하면 AS path가 가장 긴 공통 AS path(longest common AS path)로 절단 됩니다. 비활성화하면 AS path는 모든 기여 AS path의 set과 sequence 로 구성됩니다. | Selected / Cleared, 기본값 Cleared |
| Contribute All IPv4 Routes | 그 프로토콜이 내놓는 어떤 경로라도 집약 경로를 활성화하도록 허용 할지 여부. | Selected / Cleared, 기본값 Cleared |
| IPv4 address / Subnet mask (기여 경로) | 지정한 프로토콜이 집약 경로에 기여하는 경로입니다. 기여 경로가 하나 이상 존재할 때까지 집약 경로는 활성화되지 않습니다. | Dotted-quad / 기본값 없음 |
Protocol 필드에서 고를 수 있는 기여 프로토콜과, 그 프로토콜이 포함하는 경로는 다음과 같습니다.
| Protocol | 포함되는 경로 |
|---|---|
| All | 모든 프로토콜의 경로 |
| Direct | 로컬 인터페이스와 연관된 경로만 |
| Static | 정적 경로만 |
| Aggregate | 다른(더 구체적인) 집약 경로만 |
| OSPF2 | IPv4 OSPFv2 경로만 |
| OSPF2ASE | IPv4 OSPFv2 External 경로만 |
| RIP | IPv4 RIP 경로만 |
| BGP | IPv4 BGP 경로만 |
Match Type 은 경로를 비교하는 방식을 정합니다. 경로는 입력한 Address와 Subnet mask로 필터링됩니다.
| Match Type | 의미 |
|---|---|
| None | 지정한 경로와 같거나(equal), 더 구체적인(more specific) 경로를 모두 매칭합니다. (기본값) |
| Refines | 지정한 경로보다 더 구체적인 경우에만 매칭합니다. |
| Exact | 지정한 경로의 From Address와 Subnet mask에 정확히 일치할 때만 매칭합니다. |
Gaia Portal에서 IPv6 집약 경로 추가하기
IPv6도 절차가 거의 같습니다. 차이는 주소를 IPv6 address / Mask length 형태 로 입력하고, 서브넷 마스크를 따로 입력하지 않는다는 점, 그리고 선택할 수 있는 프로토콜 목록이 IPv6용으로 바뀐다는 점입니다.
- 탐색 트리에서 Advanced Routing > Route Aggregation 을 클릭합니다.
- Route Aggregation 섹션에서 Add 를 누르고 IPv6 를 선택합니다.
- IPv6 address / Mask length 필드에 새 기여 경로의 IPv6 주소와 마스크 길이를 입력합니다(집약 경로를 활성화하며, 하나의 라우팅 테이블 항목에 대응. 기본값 없음).
- Rank 를 입력합니다(0–255, 기본값 130).
- Weight 를 입력합니다(0–65535, 기본값 0).
- AS Path Truncate 옵션을 정합니다(Selected/Cleared, 기본값 Cleared).
- Contributing Routes 섹션에서 Add 를 누릅니다.
- Protocol 필드에서 기여 프로토콜을 선택합니다.
- Contribute All IPv6 Routes 옵션을 정합니다(Selected/Cleared, 기본값 Cleared).
- IPv6 address / Mask length 필드에 기여 경로의 주소와 마스크 길이를 입력합니다(기여 경로가 하나 이상 존재할 때까지 집약 경로는 활성화되지 않음).
- Match Type 을 선택합니다(None / Refines / Exact, 기본값 None — IPv4와 의미 동일).
- OK 를 클릭합니다.
- Save 를 클릭합니다.
IPv6에서 고를 수 있는 기여 프로토콜은 다음과 같습니다.
| Protocol | 포함되는 경로 |
|---|---|
| All | 모든 프로토콜의 경로 |
| Direct | 로컬 인터페이스와 연관된 경로만 |
| Static | 정적 경로만 |
| Aggregate | 다른(더 구체적인) 집약 경로만 |
| OSPF3 | IPv6 OSPFv3 경로만 |
| OSPF3ASE | IPv6 OSPFv3 External 경로만 |
| RIPng | IPv6 RIPng 경로만 |
| BGP | IPv6 BGP 경로만 |
Gaia Clish에서 Route Aggregation 구성하기
Gaia Clish에서 Route Aggregation에 쓸 수 있는 set 명령 목록을 보려면 다음을 입력합니다.
set aggregate[Esc][Esc]IPv4 집약 경로의 구문은 다음과 같습니다.
set aggregate <IPv4 Address>/<IPv4 Mask Length>
aspath-truncate {off | on}
contributing-protocol <Protocol>
contributing-route <IPv4 Address>/<IPv4 Mask Length>
exact on
{off | on}
refines on
off
off
rank {<0-255> | default}
weight {<0-255> | default}IPv6 집약 경로의 구문은 다음과 같습니다.
set ipv6 aggregate <IPv6 Address>/<IPv6 Mask Length>
aspath-truncate {off | on}
contributing-protocol <Protocol>
contributing-route <IPv6 Address>/<IPv6 Mask Length>
exact on
{off | on}
refines on
off
off
rank {<0-255> | default}
weight {<0-255> | default}각 파라미터의 의미와 값 범위는 아래와 같습니다.
| 파라미터 | 설명 | 범위 / 기본값 | |
|---|---|---|---|
set aggregate <IPv4 Address>/<IPv4 Mask Length> | 프로토콜이 기여하면 활성화되는 집약 경로를 구성합니다. 주소와 마스크 길이는 하나의 라우팅 테이블 항목에 대응합니다. | 주소: Dotted-quad / 마스크 길이: 1–32, 기본값 없음 | |
set ipv6 aggregate <IPv6 Address>/<IPv6 Mask Length> | IPv6 집약 경로를 구성합니다. | 주소: [0000-FFFF]:…:[0000-FFFF] / 마스크 길이: 1–128, 기본값 없음 | |
| `aspath-truncate {off | on}` | AS path 절단 모드. on 이면 가장 긴 공통 AS path로 절단, off 이면 모든 기여 AS path의 set·sequence로 구성. | off / on, 기본값 off |
contributing-protocol <Protocol> | 집약 경로에 포함할 경로를 내놓는 기여 프로토콜(아래 목록 참고). | — | |
contributing-route <IPv4 Address>/<IPv4 Mask Length> | 지정 프로토콜이 집약에 기여하는 경로. 기여 경로가 하나 이상 있어야 집약이 활성화됨. all-ipv4-routes 값은 그 프로토콜이 내놓는 어떤 경로든 집약을 활성화하게 함. | Dotted-quad /[1-32] 또는 all-ipv4-routes, 기본값 none | |
contributing-route <IPv6 Address>/<IPv6 Mask Length> | IPv6 기여 경로. all-ipv6-routes 값은 어떤 경로든 집약을 활성화하게 함. | IPv6 /[1-128] 또는 all-ipv6-routes, 기본값 none | |
contributing-route … exact on | 지정 경로의 From Address와 Subnet mask에 정확히 일치하는 경우에만 매칭. exact on도 refines on도 설정하지 않으면, 지정 경로와 같거나 더 구체적인 경로를 모두 매칭. | — | |
| `contributing-route … {off | on}` | 기여 경로를 집약에서 제거(off)하거나 추가(on). | off / on, 기본값 none |
contributing-route … refines on | 지정 경로보다 더 구체적인 경우에만 매칭. | — | |
contributing-protocol <Protocol> off | 해당 기여 프로토콜을 제거. | — | |
set aggregate <IPv4 …> off | 이 IPv4 집약 경로를 제거. | — | |
set ipv6 aggregate <IPv6 …> off | 이 IPv6 집약 경로를 제거. | — | |
| `rank {<0-255> | default}` | 새 기여 경로의 rank. 서로 다른 프로토콜이 같은 목적지로 갈 때 rank가 가장 낮은 프로토콜의 경로 가 사용됨. | 0–255, 기본값 130 |
| `weight {<0-255> | default}` | rank 다음의 두 번째 동점 결정자. weight가 가장 높은 경로가 active가 되어 커널 포워딩 테이블에 설치되고 재분배됨. | 0–65535, 기본값 0 |
contributing-protocol <Protocol> 에 쓸 수 있는 값은 다음과 같습니다.
- all — 모든 프로토콜의 경로
- aggregate — 다른(더 구체적인) 집약 경로만
- bgp — IPv4 BGP 또는 IPv6 BGP 경로만
- direct — 로컬 인터페이스와 연관된 경로만
- ospf2 — IPv4 OSPFv2 경로만
- ospf2ase — IPv4 OSPFv2 External 경로만
- ospf3 — IPv6 OSPFv3 경로만
- ospf3ase — IPv6 OSPFv3 External 경로만
- rip — IPv4 RIP 경로만
- ripng — IPv6 RIPng 경로만
- static — 정적 경로만
---
Routing Policy — 받고 알릴 경로 정하기
Routing Policy 는 어떤 경로를 받아들이고(import), 어떤 경로를 알릴지(export), 그 속성을 어떻게 바꿀지 를 규칙으로 정합니다. Gaia에서는 RIP, OSPFv2, BGP에 대한 라우팅 정책을 다음 세 가지 방식으로 구성할 수 있습니다.
| 구성 방식 | 구성 위치 | 설명 |
|---|---|---|
| Inbound Route Filters | Gaia Portal 또는 Gaia Clish | 특정 라우팅 프로토콜이 받아들일 경로에 대한 필터 를 정의합니다. import 정책의 route map과 비슷한 역할입니다. |
| Route Redistribution | Gaia Portal 또는 Gaia Clish | 한 프로토콜에서 배운 경로를 다른 프로토콜로 재분배 합니다. 기본 경로·집약 경로 같은 정적 경로를 알리는 데도 유용합니다. export 정책의 route map과 비슷한 역할입니다. |
| Routemaps | Gaia Clish | 어떤 경로를 받아들이고 알릴지를 제어합니다. inbound/outbound 필터와 재분배를 한꺼번에 구성할 수 있고, Portal 옵션보다 더 많은 구성 옵션 을 제공합니다. 다만 기능이 완전히 동등하지는 않습니다. 프로토콜에 import/export용으로 할당된 route map은 그에 대응하는 필터와 재분배 규칙을 덮어씁니다(override). |
이 셋의 관계를 먼저 머릿속에 그려 두면 나머지 절들이 쉽게 읽힙니다. Inbound Route Filter 는 "받을 때"의 규칙, Route Redistribution 은 "내보낼 때"의 규칙이고, Route Map 은 둘 다 더 정교하게 다룰 수 있는 상위 도구이되 켜는 순간 Portal 설정을 덮어쓴다는 점이 핵심입니다.
---
Inbound Route Filters — 받아들일 경로 거르기
Inbound Route Filter 는 어떤 프로토콜에 외부(external)인 경로 중 그 프로토콜이 받아들일 경로를 정의 합니다. 기본적으로 RIP, OSPFv2(IPv4), OSPFv3(IPv6)에 외부인 모든 경로는 그 프로토콜에 받아들여집니다. 받을 경로를 좁히려면 기본 정책을 편집하거나 새 정책을 만듭니다.
Inbound Route Filter를 구성할 때 네트워크 주소를 얼마나 정밀하게 매칭할지 는 route redistribution과 동일한 Match Type 규칙을 씁니다. 매칭 방식은 다음 네 가지입니다.
- prefix와 마스크 길이를 정확히(exactly) 매칭합니다.
- prefix는 정확히 매칭하되, 마스크 길이는 지정한 값보다 큰 경로를 매칭합니다. 예를 들어 필터에
10.0.0.0/8을 지정하면, prefix가 10이고 마스크 길이가 8보다 큰 경로는 매칭되지만 마스크 길이가 정확히 8인 경로는 매칭되지 않습니다. - prefix는 정확히 매칭하되, 마스크 길이가 지정 값과 같거나 큰 경로를 매칭합니다. 예:
10.0.0.0/8을 지정하면 prefix가 10이고 마스크 길이가 8 이상인 모든 경로를 매칭합니다. - prefix는 정확히 매칭하되, 마스크 길이가 지정한 마스크 범위(range) 안에 드는 경로를 매칭합니다. 범위 값은 네트워크 마스크와 같거나 커야 합니다. 예:
10.0.0.0/8과 마스크 범위 16~8을 지정하면, prefix가 10이고 마스크 길이가 8~16 사이인 경로를 매칭합니다.
몇 가지 중요한 동작도 기억해야 합니다.
Gaia Portal에서 Inbound Route Filter 구성하기
기본 절차는 다음과 같습니다.
- 탐색 트리에서 Advanced Routing > Inbound Route Filters 를 클릭합니다.
- Inbound Route Filters 섹션에서 Add 를 누르고 필터 종류를 선택합니다.
- Add BGP Policy Filter (Based on AS-PATH) — AS-PATH 속성을 기준으로 BGP 경로를 필터링.
- Add BGP Policy Filter (Based on AS) — AS 속성을 기준으로 BGP 경로를 필터링.
- Add Individual IPv4 Route Filter — IPv4 경로 필터링.
- Add Individual IPv6 Route Filter — IPv6 경로 필터링.
- 해당 설정을 구성합니다(아래 절 참고).
- Save 를 클릭합니다.
BGP Policy Filter (Based on AS-PATH)
이 필터는 AS-PATH가 특정 정규표현식에 일치하는 BGP 경로를 import 하는 새 정책을 구성합니다.
- Policy Filter 섹션의 Add BGP Policy 필드에서:
- 왼쪽 필드 — 고유 식별자를 입력합니다. 범위는 1–511 (기본값 없음). AS는 BGP import를 제어할 수 있고, BGP는 AS-PATH 정규표현식으로 전파를 제어하며, BGPv4는 연속된 네트워크 마스크를 따라 임의의 목적지를 전파할 수 있습니다.
- 가운데 필드 — AS_PATH 정규표현식을 입력합니다(연산자는 아래 표 참고).
- 오른쪽 필드 — route origin(경로 출처)을 선택합니다.
- Action 필드에서 받아들일지(accept) 거부할지(reject)를 선택합니다(아래 Action 표 참고).
- Policy Default Modifiers 섹션의 Local Preference 필드에 기본 local preference를 입력합니다.
- Policy Default Modifiers 섹션의 Weight 필드에 기본 route weight를 입력합니다.
- Save 를 클릭합니다.
AS_PATH 정규표현식 연산자 — 유효한 AS_PATH 정규표현식은 숫자와 다음 특수문자만 포함할 수 있습니다.
| 연산자 | 설명 | ||
|---|---|---|---|
. | 임의의 한 문자와 일치(period). | ||
\ | 바로 뒤 문자와 일치(backslash). 패턴 재호출 시에는 backslash 뒤 숫자가 가리키는 패턴과 일치. | ||
^ | AS path의 시작 에 있는 문자 또는 null 문자열과 일치(circumflex). | ||
$ | AS path의 끝 에 있는 문자 또는 null 문자열과 일치(dollar). | ||
? | 앞 패턴이 0회 또는 1회 나타나는 것과 일치. | ||
* | 앞 패턴이 0회 이상 나타나는 것과 일치(asterisk). | ||
+ | 앞 패턴이 1회 이상 나타나는 것과 일치(plus). | ||
| ` | ` | ` | ` 양쪽 패턴 중 하나와 일치(pipeline). |
_ | 쉼표(,), 왼쪽 brace({), 오른쪽 brace(}), ASPath 시작(^), ASPath 끝($), 공백(space/tab)과 일치(underscore). | ||
[ ] | brackets 안의 문자 집합 또는 하이픈(-)으로 구분된 문자 범위와 일치. | ||
( ) | 하나 이상의 패턴을 하나의 패턴으로 묶음(round brackets). | ||
{m n} | 앞 패턴이 최소 m회, 최대 n회 반복되는 것과 일치(m, n은 양의 정수이며 m ≤ n). | ||
{m} | 앞 패턴이 정확히 m회 반복되는 것과 일치(m은 양의 정수). | ||
{m,} | 앞 패턴이 m회 이상 반복되는 것과 일치(m은 양의 정수). |
Route origin(경로 출처) 선택지는 다음과 같습니다.
- Any — 어떤 프로토콜에서든 배운 경로로, path가 거의 완전(complete)함.
- IGP — 내부 라우팅 프로토콜에서 배운 경로로, path가 거의 완전함.
- EGP — AS-PATH를 지원하지 않는 외부 라우팅 프로토콜에서 배운 경로로, path가 불완전(incomplete)할 가능성이 큼.
- Incomplete — 경로 path 정보가 불완전함.
Action(동작) 선택지는 다음과 같습니다.
| Action | 설명 |
|---|---|
| Accept IPv4 & IPv6 | 이 필터에 매칭되는 모든 IPv4·IPv6 경로를 받아들임. 단 더 구체적인 규칙으로 명시적으로 restrict된 경로는 제외. restrict를 설정하지 않으면 받아들이는 것이 기본 동작. |
| Restrict IPv4 & IPv6 | 매칭되는 모든 IPv4·IPv6 경로를 거부. 단 더 구체적인 필터가 "accept"로 설정된 경로는 제외. |
| Accept IPv4, Restrict IPv6 | 매칭되는 IPv6 경로는 거부(더 구체적 accept 필터 제외), IPv4 경로는 모두 받아들임. |
| Restrict IPv4, Accept IPv6 | 매칭되는 IPv4 경로는 거부(더 구체적 accept 필터 제외), IPv6 경로는 모두 받아들임. |
Local Preference / Weight 수정자 의 동작과 주의 사항은 다음과 같습니다(이 두 필드는 BGP Policy Filter 전반에 공통).
- Local Preference — 이 필터에 매칭되는 모든 경로에 BGP local preference를 할당합니다(다른 local preference 값을 가진 더 구체적인 필터에 매칭되는 경로는 제외). external BGP 경로를 internal BGP 경로로 재분배할 때 이 값이 자동으로 전송됩니다. internal BGP import 문에 쓰면 무시됩니다. 라우팅 시스템이 경쟁하는 BGP 경로 중에서 고를 때 값이 클수록 선호 됩니다. 범위 0–4294967295, 기본값 없음. > Best Practice — BGP 경로 선호도를 편향시키는 권장 방법은 local preference 구성 입니다.
BGP Policy Filter (Based on AS)
이 필터는 특정 피어 AS로부터 BGP 경로를 import 하는 새 정책을 구성합니다.
- Policy Filter 섹션의 Add BGP Policy 필드에서:
- 왼쪽 필드 — 고유 식별자를 입력합니다. 범위는 512–1024 (기본값 없음). BGP는 피어 AS 번호를 기준으로 서로 다른 BGP 피어로부터 경로를 받아들일 수 있습니다.
- 가장 오른쪽 필드 — 이 import 정책을 적용할 피어 BGP AS 번호를 선택합니다. 유효한 ASPLAIN 또는 ASDOT 번호를 입력합니다. 범위는 1–4294967295(ASPLAIN) 또는 0.1–65535.6553(ASDOT), 기본값 없음.
- Action 필드에서 받아들일지/거부할지 선택합니다(위 Action 표와 동일).
- Local Preference 를 입력합니다(위와 동일, 범위 0–4294967295).
- Weight 를 입력합니다(위와 동일, 범위 0–65535).
- Save 를 클릭합니다.
Add Individual IPv4 Route Filter
- Route Filter 섹션의 Import From 필드에서 프로토콜을 선택합니다.
| Protocol | 설명 |
|---|---|
| OSPFv2 | OSPFv2에서 배운 IPv4 경로의 inbound 필터링. OSPF inbound 필터는 OSPF ASE 경로에만 적용 되며, Intra-area·Inter-area OSPF 경로는 항상 설치됩니다. 기본 동작은 모든 OSPF ASE 경로 수용. |
| RIP | RIP에서 배운 IPv4 경로의 inbound 필터링. |
| BGP Policy <ID> | BGP에서 배운 IPv4 경로의 inbound 필터링. 앞서 만든 "Based on AS-PATH" 또는 "Based on AS" 정책 필터가 이 메뉴에 표시됩니다. |
- Route 필드에 주소 범위의 IPv4 주소와 마스크 길이를 CIDR 표기로 입력합니다(주어진 프로토콜에서 특정 주소 범위에 매칭되는 경로를 import하는 정책. 범위 Dotted-quad
/[0-32], 기본값 없음). - Match Type 필드에서 매칭 방식을 선택합니다.
| Match Type | 의미 |
|---|---|
| Exact | prefix와 마스크 길이가 지정 네트워크와 정확히 같은 경로만 매칭. |
| Normal | 지정 네트워크 안에 포함되는 모든 경로 를 매칭. |
| Refines | 지정 네트워크에 포함되되 더 구체적인(예: 더 긴 마스크 길이) 경로만 매칭. |
| Range | prefix가 지정 네트워크와 같고, 마스크 길이가 특정 범위에 드는 경로를 매칭(범위 1–32). |
- Action 필드에서 Accept(이 경로 수용) 또는 Restrict(이 경로 거부)를 선택합니다.
- Policy Modifiers 섹션에서 적용할 설정을 구성합니다.
- Import From 에서 OSPFv2 또는 RIP을 선택한 경우 — Rank 필드에 기본 route rank를 입력합니다. 이 필터에 매칭되는 모든 들어오는 경로에 rank를 할당합니다(다른 rank를 가진 더 구체적 규칙 매칭 경로 제외). 라우팅 시스템은 rank가 가장 낮은 프로토콜의 경로 를 사용합니다. 범위 0–255, 기본값은 OSPFv2면 "OSPFASE"의 프로토콜 rank, RIP이면 "RIP"의 프로토콜 rank. ("restrict" 규칙에는 rank를 구성할 수 없습니다.)
- Import From 에서 BGP를 선택한 경우 — Local Preference(위 설명·주의 사항과 동일, 범위 0–4294967295)와 Weight(위와 동일, 범위 0–65535)를 입력합니다.
- Save 를 클릭합니다.
Add Individual IPv6 Route Filter
IPv6 개별 경로 필터도 절차가 같습니다. 차이는 Import From 에서 고를 수 있는 프로토콜이 다르다는 점입니다.
| Protocol | 설명 |
|---|---|
| OSPFv3 | OSPFv3에서 배운 IPv6 경로의 inbound 필터링. |
| BGP Policy <ID> | BGP에서 배운 IPv6 경로의 inbound 필터링. 앞서 만든 "Based on AS-PATH"/"Based on AS" 정책 필터가 표시됨. |
- Import From 에서 프로토콜을 선택합니다.
- Route 필드에 IPv6 주소와 마스크 길이를 CIDR 표기로 입력합니다(범위 IPv6
/[0-128], 기본값 없음). - Match Type 을 선택합니다(Exact / Normal / Refines / Range — IPv4와 의미 동일).
- Action 에서 Accept 또는 Restrict 를 선택합니다.
- Policy Modifiers 에서 — OSPFv2/RIP을 골랐다면 Rank, BGP를 골랐다면 Local Preference 와 Weight 를 위 설명과 동일하게 구성합니다.
- Save 를 클릭합니다.
Gaia Clish에서 IPv4 BGP용 Inbound Route Filter 구성하기
쓸 수 있는 set 명령과 현재 구성을 보려면 다음을 입력합니다.
set inbound-route-filter[Esc][Esc]
show configuration inbound-route-filter구문은 다음과 같습니다.
set inbound-route-filter bgp-policy <BGP Import Policy ID>
accept-all-ipv4
accept-all-ipv6
based-on-as as <AS Number> on
based-on-aspath aspath-regex {<Regular Expression> | empty} origin {any | egp | igp | incomplete} on
community-match <1-65535> as <1-65535> {off | on}
default-localpref {0-4294967295 | default}
default-weight {0-65535 | default}
off
restrict-all-ipv4
restrict-all-ipv6
route <IPv4 or IPv6 Address>/<Mask Length>
accept
between <Start IPv4 Mask Length> and <End IPv4 Mask Length> on
between <Start IPv4 Mask Length> and <End IPv4 Mask Length> restrict on
exact on
exact restrict on
localpref {0-4294967295 | default}
normal on
normal restrict on
off
refines on
refines restrict on
weight {0-65535 | default}주요 파라미터는 다음과 같습니다.
| 파라미터 | 설명 | ||||
|---|---|---|---|---|---|
bgp-policy <BGP Import Policy ID> | BGP Import Policy의 ID. 1–511 은 AS-PATH 속성 기준 import, 512–1024 는 AS Number 속성 기준 import. | ||||
accept-all-ipv4 / accept-all-ipv6 | 이 필터에 매칭되는 모든 IPv4/IPv6 경로를 수용(더 구체적 규칙으로 restrict된 경로 제외). restrict를 설정하지 않으면 기본 동작. | ||||
based-on-as as <AS Number> on | 특정 피어 AS로부터 BGP 경로를 import하는 새 정책 구성. | ||||
| `based-on-aspath aspath-regex {<Regular Expression> | empty} origin {any | egp | igp | incomplete} on` | AS-PATH가 특정 정규표현식에 일치하는 BGP 경로를 import하는 정책 구성. 빈 정규표현식을 만들려면 empty 사용. |
| `community-match <1-65535> as <1-65535> {off | on}` | BGP Community 속성에 특정 Community를 포함하는 경로를 매칭. 각 Community는 Community ID와 AS 번호로 식별. off 는 이 필터 제거, on 은 추가. | |||
| `default-localpref {0-4294967295 | default}` | 매칭 경로에 기본 BGP local preference 할당(주의 사항은 Portal 절과 동일). 범위 0–4294967295, 기본값 없음. | |||
| `default-weight {0-65535 | default}` | 매칭 경로에 기본 BGP weight 할당(음수 weight·세션 유지 동작은 위와 동일). 범위 0–65535, 기본값 없음. | |||
bgp-policy <ID> off | 이 BGP import 정책을 구성에서 삭제. | ||||
restrict-all-ipv4 / restrict-all-ipv6 | 매칭되는 모든 IPv4/IPv6 경로 거부(더 구체적 accept 필터 제외). | ||||
route <Addr>/<Mask> | 특정 네트워크에 대한 import 정책 구성. IPv4 /[0-32], IPv6 /[0-128]. 기본값 없음. | ||||
route … accept | 이 경로 수용. | ||||
route … between <Start> and <End> on | prefix가 지정 네트워크와 같고 마스크 길이가 범위에 드는 경로를 수용. | ||||
route … between <Start> and <End> restrict on | 위 매칭에 해당하는 경로 거부(더 구체적 accept 제외). | ||||
route … exact on / exact restrict on | prefix·마스크 길이가 정확히 같은 경로만 수용 / 거부. | ||||
| `route … localpref {0-4294967295 | default}` | 매칭 경로에 BGP local preference 할당(주의 사항 동일). | |||
route … normal on / normal restrict on | 지정 네트워크와 같거나 그 안에 포함되는 경로 수용 / 거부. | ||||
route … off | 이 주소 필터를 import 정책에서 제거. | ||||
route … refines on / refines restrict on | 지정 네트워크에 포함되되 더 구체적인 경로만 매칭(수용 / 거부). | ||||
| `route … weight {0-65535 | default}` | 매칭 경로에 BGP weight 할당(음수 weight 동작 동일). |
예제 1 — AS 4에서 받은 모든 IPv4·IPv6 경로 수용.
set inbound-route-filter bgp-policy 512 based-on-as as 4 on
set inbound-route-filter bgp-policy 512 accept-all-ipv4
set inbound-route-filter bgp-policy 512 accept-all-ipv6예제 2 — 10.0.0.0/8 의 서브넷, 또는 AS 22에서 온 정확한 경로 1234::/64 만 수용하고 기본 local preference 할당.
set inbound-route-filter bgp-policy 1000 based-on-as as 22 on
set inbound-route-filter bgp-policy 1000 restrict-all-ipv4
set inbound-route-filter bgp-policy 1000 restrict-all-ipv6
set inbound-route-filter bgp-policy 1000 route 10.0.0.0/8 normal on
set inbound-route-filter bgp-policy 1000 route 1234::/64 exact on
set inbound-route-filter bgp-policy 1000 default-localpref 1000Gaia Clish에서 IPv4 OSPFv2용 Inbound Route Filter 구성하기
OSPF inbound 필터는 OSPF ASE 경로에만 적용 됩니다. Intra-area·Inter-area OSPF 경로는 항상 설치되며, 기본 동작은 모든 OSPF ASE 경로 수용입니다. set 명령과 현재 구성을 보는 방법은 BGP와 같습니다(set inbound-route-filter[Esc][Esc], show configuration inbound-route-filter).
set inbound-route-filter ospf2 [instance <OSPF Instance Number>]
accept-all-ipv4
rank {<0-255> | default}
restrict-all-ipv4
route <IPv4 Address>/<Mask Length>
accept
between <Start IPv4 Mask Length> and <End IPv4 Mask Length> on
between <Start IPv4 Mask Length> and <End IPv4 Mask Length> restrict on
exact on
exact restrict on
normal on
normal restrict on
off
rank {<0-255> | default}
refines on
refines restrict on주요 파라미터:
| 파라미터 | 설명 | |
|---|---|---|
set inbound-route-filter ospf2 [instance <…>] | (지정 OSPF 인스턴스의) IPv4 OSPFv2 Import Policy 구성. | |
accept-all-ipv4 / restrict-all-ipv4 | 매칭되는 모든 IPv4 경로 수용 / 거부. | |
| `rank {<0-255> | default}` | 매칭 경로에 rank 할당. 기본값은 "OSPFASE" 의 프로토콜 rank(show protocol-rank 로 확인). |
route <…> 및 accept / between / exact / normal / off / rank / refines(필요 시 restrict on) | BGP 절의 같은 이름 파라미터와 의미 동일. 단 OSPF는 rank 수정자 를 가질 수 있습니다. |
예제 — 192.168.0.0/16 의 서브넷만 수용하되, 그 경로 자체는 수용하지 않음.
set inbound-route-filter ospf2 restrict-all-ipv4
set inbound-route-filter ospf2 route 192.168.0.0/16 refines onGaia Clish에서 IPv4 RIP용 Inbound Route Filter 구성하기
RIP의 기본 동작은 모든 RIP 경로 수용입니다. 구문은 OSPFv2와 거의 같습니다.
set inbound-route-filter rip
accept-all-ipv4
rank {<0-255> | default}
restrict-all-ipv4
route <IPv4 Address>/<Mask Length>
accept
between <Start Mask Length> and <End Mask Length> on
between <Start Mask Length> and <End Mask Length> restrict on
exact on
exact restrict on
normal on
normal restrict on
off
rank {<0-255> | default}
refines on
refines restrict on차이는 rank 의 기본값이 "RIP" 의 프로토콜 rank(show protocol-rank 로 확인)라는 점입니다. 나머지 파라미터 의미는 위 절들과 같습니다.
예제 — 172.16.0.0/16 과 그 서브넷만 빼고 모든 IPv4 경로 수용.
set inbound-route-filter rip accept-all-ipv4
set inbound-route-filter rip route 172.16.0.0/16 normal restrict onGaia Clish에서 IPv6 OSPFv3용 Inbound Route Filter 구성하기
OSPFv3 inbound 필터도 OSPFv3 ASE 경로에만 적용 되고, Intra-area·Inter-area OSPFv3 경로는 항상 설치되며, 기본 동작은 모든 OSPFv3 ASE 경로 수용입니다. IPv6용 명령과 구성 조회는 다음과 같습니다.
set ipv6 inbound-route-filter[Esc][Esc]
show configuration ipv6 inbound-route-filterset ipv6 inbound-route-filter ospf3 [instance {<1-65535> | default}]
accept-all-ipv6
rank {<0-255> | default}
restrict-all-ipv6
route <IPv6 Address>/<Mask Length>
accept
exact on
exact restrict on
normal on
normal restrict on
off
rank {<0-255> | default}
refines on
refines restrict onIPv6 OSPFv3에서는 between(범위) 매칭이 제공되지 않습니다 — exact / normal / refines만 사용합니다. rank 의 기본값은 "OSPF3ASE" 의 프로토콜 rank 입니다. 나머지 파라미터 의미는 IPv4 OSPFv2 절과 같습니다.
예제 — 모든 경로를 수용하되 5678::/64 의 서브넷에는 다른 프로토콜 rank 부여.
set ipv6 inbound-route-filter ospf3 accept-all-ipv6
set ipv6 inbound-route-filter ospf3 route 5678::/64 normal on
set ipv6 inbound-route-filter ospf3 route 5678::/64 rank 15---
Route Redistribution — 한 프로토콜의 경로를 다른 프로토콜로
Route Redistribution(경로 재분배) 은 라우터가 한 라우팅 프로토콜의 경로를 다른 라우팅 프로토콜로 전파(IPv4 또는 IPv6) 하게 합니다. 기본 경로, 정적 경로, 집약 경로를 알리는 데도 유용합니다.
Gaia Portal에서 Route Redistribution 구성하기
기본 절차:
- 탐색 트리에서 Advanced Routing > Route Redistribution 을 클릭합니다.
- Route Redistributions 섹션에서 — 추가하려면 Add Redistribution From, 편집하려면 항목을 선택하고 Edit 를 누릅니다.
- 해당 설정을 구성합니다.
- Save 를 클릭합니다.
소스(어디서 재분배할지)에 따라 입력 항목이 달라집니다. 아래에 소스별로 정리했습니다.
Add Redistribution From – Interface(인터페이스 경로 재분배)
| 파라미터 | 설명 |
|---|---|
| To Protocol | 대상 라우팅 프로토콜. |
| Interface | 경로를 분배할 인터페이스. all 또는 구성된 인터페이스 중 하나 선택. |
| Metric | 대상 프로토콜에서 재분배 경로의 cost. |
Add Redistribution From – Static(정적 경로 재분배)
| 파라미터 | 설명 |
|---|---|
| To Protocol | RIP / OSPFv2 / BGP AS <Peer Group AS> / RIPng / OSPFv3 중 하나. |
| Static Route | 재분배할 정적 경로: All IPv4 Routes / Default / All IPv6 Routes. |
| Metric | 재분배 경로의 cost. RIP로 재분배할 때는 필수. |
Add Redistribution From – Aggregate(집약 경로 재분배)
| 파라미터 | 설명 |
|---|---|
| To Protocol | RIP / OSPFv2 / BGP AS <Peer Group AS>. |
| Aggregate Route | 재분배할 경로: All IPv4 Routes. |
| Metric | 재분배 경로의 cost. RIP로 재분배할 때 필수. |
Add Redistribution From – NAT Pool(NAT Pool 재분배)
| 파라미터 | 설명 |
|---|---|
| To Protocol | 대상 라우팅 프로토콜. |
| NAT Pool | 분배할 NAT Pool. All IPv4 Routes / All IPv6 Routes / 구성된 NAT Pool 중 하나. |
| Metric | 재분배 경로의 cost. |
Add Redistribution From – Kernel(OS 커널 경로 재분배)
| 파라미터 | 설명 |
|---|---|
| To Protocol | RIP / OSPFv2 / BGP AS / RIPng / OSPFv3. |
| Route | 재분배할 경로: All IPv4 Routes / All IPv6 Routes를 고르거나, Address Range로 특정 경로 지정. 매칭은 Exact(prefix·마스크 정확히 일치) / Normal(지정 네트워크에 포함) / Refines(포함되되 더 구체적). |
| Metric | 재분배 경로의 cost. RIP로 재분배할 때 필수. |
Add Redistribution From – RIP(RIP 경로 재분배)
| 파라미터 | 설명 |
|---|---|
| To Protocol | OSPFv2 / BGP AS. |
| Route | All IPv4 Routes 또는 Address Range. 매칭: Exact / Normal / Refines. |
| Action | 이 경로 수용/거부. |
| Metric | OSPFv2: 1–16777215, BGP AS: 1–4294967295. |
Add Redistribution From – OSPFv2, OSPFv2 External(OSPFv2 경로 재분배)
| 파라미터 | 설명 |
|---|---|
| To Protocol | RIP / OSPFv2 / BGP AS. |
| Route | All IPv4 Routes 또는 Address Range. 매칭: Exact / Normal / Refines. |
| Action | 수용/거부. |
| Metric | 재분배 경로 cost. RIP로 재분배할 때 필수(범위는 위 공통 표 참고). |
| RIP Tag | (선택) export 경로에 할당할 RIP 태그. 범위 1–65535. |
Add Redistribution From – BGP Based on AS-Path(AS-Path 기준 BGP 경로 재분배)
| 파라미터 | 설명 |
|---|---|
| To Protocol | RIP / OSPFv2 / BGP AS / RIPng / OSPFv3. |
| From BGP AS-Path | AS_PATH 정규표현식(숫자와 특수문자만, 연산자는 앞의 AS_PATH 정규표현식 표 참고). 이어서 route origin(Any / IGP / EGP / Incomplete) 구성. |
| Route | All IPv4 Routes / All IPv6 Routes 또는 Address Range. 매칭: Exact / Normal / Refines. |
| Action | 수용/거부. |
| Metric | 재분배 경로 cost. RIP로 재분배할 때 필수. |
| RIP Tag | (선택) export 경로의 RIP 태그. 범위 1–65535. |
| Automatic Tag | (선택) BGP AS를 기반으로 external OSPF route 태그를 자동 생성. 활성화하면 export 시 external OSPF 경로에 태그가 붙음. |
| Manual Tag | (선택) export 경로에 할당할 external OSPF route 태그. |
Add Redistribution From – BGP Based on AS(AS Number 기준 BGP 경로 재분배)
| 파라미터 | 설명 |
|---|---|
| To Protocol | RIP / OSPFv2 / BGP AS / RIPng / OSPFv3. |
| From BGP AS | AS Number: BGP AS <Peer Group AS>. |
| Route | All IPv4 Routes / All IPv6 Routes 또는 Address Range. 매칭: Exact / Normal / Refines. |
| Action | 수용/거부. |
| Metric | RIP로 재분배할 때 필수(공통 범위). |
| RIP Tag / Automatic Tag / Manual Tag | 위 AS-Path 소스와 동일(Manual Tag가 Automatic Tag보다 우선, 범위 1–2147483647). |
Add Redistribution From – BGP Default Origin(모든 IPv4 경로를 BGP로)
| 파라미터 | 설명 |
|---|---|
| To Protocol | BGP AS <Peer Group AS>. |
| Metric | 재분배 경로의 cost. 범위 1–4294967295. |
Add Redistribution From – RIPng(IPv6 RIPng 경로 재분배)
| 파라미터 | 설명 |
|---|---|
| To Protocol | BGP AS / OSPFv3. |
| Route | All IPv6 Routes 또는 Address Range. 매칭: Exact / Normal / Refines. |
| Action | 수용/거부. |
| Metric | BGP AS: 1–4294967295, OSPFv3: 1–16777215. |
Add Redistribution From – OSPFv3, OSPFv3 External(IPv6 OSPFv3 경로 재분배)
| 파라미터 | 설명 |
|---|---|
| To Protocol | BGP AS / RIPng / OSPFv3. |
| Route | All IPv6 Routes 또는 Address Range. 매칭: Exact / Normal / Refines. |
| Action | 수용/거부. |
| Metric | BGP AS: 1–4294967295, OSPFv3: 1–16777215. |
BGP Redistribution Settings 구성
BGP로 재분배할 때의 추가 설정은 별도로 구성합니다.
- 탐색 트리에서 Advanced Routing > Route Redistribution 을 클릭합니다.
- BGP Redistribution Settings 섹션에서 BGP Group을 선택하고 Edit 를 누릅니다.
- 설정을 구성합니다.
- MED (Multi-Exit Discriminator) — 이 경로 사용의 cost(0–4294967295).
- Local Preference — BGP로 재분배될 때의 로컬 BGP 경로 선호 값(0–4294967295). 클수록 더 선호 됩니다.
- Match AS Numbers to Communities 섹션에서 Add — BGP Community 속성에 지정한 Community가 포함된 BGP 경로에만 이 재분배 규칙을 적용. 해당 Community와 AS Number를 구성하고 OK.
- Append AS Numbers to Communities 섹션에서 Add — 이 규칙으로 export되는 경로에 BGP Community를 덧붙임(append). Community와 AS Number를 구성하고 OK.
- Save 를 클릭합니다.
Gaia Clish에서 IPv4 Route Redistribution 구성하기
쓸 수 있는 명령과 현재 구성을 보려면:
set route-redistribution[Esc][Esc]
show configuration route-redistribution[Esc][Esc]일반 구문은 대상(to)과 소스(from)를 한 줄에 잇는 형태입니다.
set route-redistribution to <Destination Protocol> <Destination Protocol Parameters> from <Source Protocol> <Source Protocol Parameters>- 대상(destination) 옵션 — BGP, OSPFv2, RIP. 각 대상 프로토콜은 자체 파라미터 집합을 가집니다.
- 소스(source) 옵션 — BGP(특정 AS), BGP(특정 AS path), OSPFv2, OSPFv2 External, RIP, NAT Pools.
- 그 밖에 집약 경로, 기본 경로, 특정 인터페이스 경로, 정적 경로 도 재분배할 수 있습니다.
IPv4 Route Redistribution to BGP
BGP 피어 AS로 경로를 export하는 정책입니다. 명령·조회는 다음과 같습니다.
set route-redistribution to bgp-as[Esc][Esc]
show configuration route-redistribution[Esc][Esc]소스별 구문은 패턴이 거의 같습니다. 공통 골격은 "set route-redistribution to bgp-as <BGP Group AS> from <소스> … [metric {<0-4294967295> | default}] on" 이며, 끝에 off 를 붙이면 해당 재분배를 끕니다. 소스별 구문을 모아 보면 다음과 같습니다.
# Interface
set route-redistribution to bgp-as <BGP Group AS>
from interface <Name of Interface> [metric {<0-4294967295> | default}] on
off
# Static
set route-redistribution to bgp-as <BGP Group AS>
from static-route {all-ipv4-routes | all-ipv6-routes | default | default6} [metric …] on
off
# Aggregate
set route-redistribution to bgp-as <BGP Group AS>
from aggregate {all-ipv4-routes | <IPv4 Address>/<Mask Length>} [metric …] on
off
# Kernel
set route-redistribution to bgp-as <BGP Group AS> from kernel
all-ipv4-routes [metric …] on
off
all-ipv6-routes [metric …] on
off
network <IPv4 or IPv6 Address>/<Mask Length> on [metric …] on
action {accept | restrict}
match-type exact on
match-type normal on
match-type range between <Start Mask Length> and <End Mask Length> on
match-type refines on
off
# RIP
set route-redistribution to bgp-as <BGP Group AS> from rip
all-ipv4-routes [metric …] on
off
network <IPv4 Address>/<Mask Length> on [metric …] on
action {accept | restrict}
match-type exact on
match-type normal on
match-type range between <Start Mask Length> and <End Mask Length> on
match-type refines on
off
# OSPFv2
set route-redistribution to bgp-as <BGP Group AS> from ospf2 [instance <OSPF Instance>]
all-ipv4-routes [metric …] on
off
network <IPv4 Address>/<Mask Length> on [metric …] on
action {accept | restrict}
match-type {exact | normal | range between <Start> and <End> | refines} on
off
# OSPFv2 External
set route-redistribution to bgp-as <BGP Group AS> from ospf2ase [instance <OSPF Instance>]
…(OSPFv2와 동일 구조)…
# BGP Based on AS-Path
set route-redistribution to bgp-as <BGP Group AS> from bgp-as-path <Regular Expression>
origin {any | IGP | EGP | incomplete}
all-ipv4-routes [metric …] on
off
all-ipv6-routes [metric …] on
off
network <IPv4 or IPv6 Address>/<Mask Length> on [metric …] on
action {accept | restrict}
match-type {exact | normal | range between <Start> and <End> | refines} on
off
# BGP Based on AS
set route-redistribution to bgp-as <BGP Group AS> from bgp-as-number <AS Number 1-65535>
all-ipv4-routes [metric …] on
off
all-ipv6-routes [metric …] on
off
network <IPv4 or IPv6 Address>/<Mask Length> on [metric …] on
action {accept | restrict}
match-type {exact | normal | range between <Start> and <End> | refines} on
off
# BGP Default Origin
set route-redistribution to bgp-as <BGP Group AS> from default-origin
all-ipv4-routes [metric …] on
off
# RIPng (IPv6 — range 매칭 없음)
set route-redistribution to bgp-as <BGP Group AS> from ripng
all-ipv6-routes [metric …] on
off
network <IPv6 Address>/<Mask Length> on [metric …] on
action {accept | restrict}
match-type {exact | normal | refines} on
off
# OSPFv3 / OSPFv3 External (IPv6 — range 매칭 없음)
set route-redistribution to bgp-as <BGP Group AS> from ospf3 [instance <OSPF Instance>]
all-ipv6-routes [metric …] on
off
network <IPv6 Address>/<Mask Length> on [metric …] on
action {accept | restrict}
match-type {exact | normal | refines} on
off
# (ospf3ase도 동일 구조)
# NAT Pool
set route-redistribution to bgp-as <BGP Group AS> from nat-pool {all-ipv4-routes | all-ipv6-routes | <IP Address>/<Mask Length>} [metric …] on
offBGP 재분배 전반에 적용되는 일반 설정은 다음과 같습니다.
set route-redistribution to bgp-as <BGP Group AS>
community-append <Community ID 1-65535> as <AS Number 1-65535> {off | on}
community-match <Community ID 1-65535> as <AS Number 1-65535> {off | on}
localpref {<0-4294967295> | default}
med {<0-4294967295> | default}
off파라미터(알파벳 순)는 다음과 같습니다.
| 파라미터 | 설명 | |||
|---|---|---|---|---|
| `[metric {<0-4294967295> | default}] on` | BGP로의 경로 재분배 활성화. | ||
| `action {accept | restrict}` | 이 경로 수용/거부. | ||
all-ipv4-routes on/off, all-ipv6-routes on/off | 이 프로토콜의 모든 IPv4/IPv6 경로 재분배 활성/비활성. | |||
| `community-append <ID> as <AS> {off | on}` | 이 규칙으로 export되는 경로에 BGP Community 덧붙임. | ||
| `community-match <ID> as <AS> {off | on}` | BGP Community 속성에 지정 Community가 있는 경로에만 이 규칙 적용. | ||
| `from aggregate {all-ipv4-routes | <IPv4 …>}` | BGP로 재분배할 IPv4 집약 경로. all-ipv4-routes 는 모든 집약 경로, <IPv4 …> 는 지정 경로만. | ||
from aggregate {…} off | 이 집약 경로의 BGP 재분배 비활성. | |||
from bgp-as-number <AS Number 1-65535> | AS Number 기준 BGP 경로 재분배. | |||
from bgp-as-path <Regular Expression> | AS-Path 속성 기준 BGP 경로 재분배(정규표현식 규칙은 앞 표 참고). | |||
from default-origin | 모든 IPv4 경로를 BGP로 재분배. | |||
from interface <Name> / off | 지정 인터페이스의 직접 연결 경로를 BGP AS로 재분배 / 비활성. | |||
from kernel | OS 커널 경로 재분배. | |||
from ospf2 [instance …] / from ospf2ase [instance …] | (지정 인스턴스의) IPv4 OSPFv2 / OSPFv2 External 경로 재분배. | |||
from rip / from ripng | IPv4 RIP / IPv6 RIPng 경로 재분배. | |||
| `from static-route {all-ipv4-routes | all-ipv6-routes | default | default6} / off` | 정적 경로 재분배(전체 IPv4/IPv6, 기본 IPv4/IPv6) / 비활성. |
| `from nat-pool {all-ipv4-routes | all-ipv6-routes | <IP …>}` | NAT Pool 재분배. | |
| `localpref {0-4294967295 | default}` | BGP로 재분배 시 로컬 BGP 경로 선호 값. 클수록 선호. | ||
match-type exact / normal / range between <Start> and <End> / refines on | 매칭 방식(앞 절들과 동일). | |||
| `med {0-4294967295 | default}` | 이 경로 사용의 cost(MED). | ||
| `metric {<0-4294967295> | default}` | (선택) 이 규칙으로 재분배되는 경로에 BGP metric 할당. BGP의 metric은 MED 로, 같은 이웃 AS에서 온 선호도가 같은 경로의 동점을 깨는 데 쓰임. MED 값이 낮을수록 선호 되고, MED가 없는 경로는 MED 0과 동률로 가장 선호됨. 범위 0–4294967295, 기본값 없음. | ||
network <Addr>/<Mask> on/off | 지정 네트워크 경로의 BGP 재분배 활성/비활성. | |||
| `origin {any | IGP | EGP | incomplete}` | route origin(앞 절과 동일). |
set route-redistribution to bgp-as <BGP Group AS> / off | BGP Group의 AS 구성 / 이 프로토콜로의 모든 재분배 비활성. |
예제
# 모든 IPv4 기본 경로를 BGP AS 100으로 재분배하고 cost 10 부여
set route-redistribution to bgp-as 100 from default-origin all-ipv4-routes metric 10 on
# 모든 정적 경로를 BGP AS 100으로 재분배
set route-redistribution to bgp-as 100 from static-route all-ipv4-routes on
# 모든 IPv4 정적 경로를 BGP AS 100으로 재분배하고 cost 1 부여
set route-redistribution to bgp-as 100 from static-route all metric 1 on
# BGP AS 100으로 재분배되는 경로에 BGP local preference 100 부여
set route-redistribution to bgp-as 100 localpref 100IPv4 Route Redistribution to OSPFv2
OSPFv2로 export하는 정책입니다. 명령·조회:
set route-redistribution to ospf2[Esc][Esc]
show configuration route-redistribution[Esc][Esc]소스별 구문은 BGP와 같은 패턴이되, metric 범위가 {<1-16777215> | default} 이고 대상이 to ospf2 [instance <OSPF Instance>] 라는 점이 다릅니다. 소스로는 Interface, Static, Aggregate, Kernel, RIP, OSPFv2, OSPFv2 External, BGP Based on AS-Path, BGP Based on AS, NAT Pool을 쓸 수 있습니다. BGP 소스에서 OSPFv2로 보낼 때는 OSPF 태그 관련 옵션 이 추가됩니다.
# 예: OSPFv2 from BGP Based on AS-Path
set route-redistribution to ospf2 [instance <OSPF Instance>] from bgp-as-path <Regular Expression>
origin {any | IGP | EGP | incomplete}
all-ipv4-routes [metric {<1-16777215> | default}] on
off
network <IP Address>/<Mask Length> [metric …] on
action {accept | restrict}
match-type {exact | normal | range between <Start> and <End> | refines} on
off
ospf-automatic-tag {off | on}
ospf-automatic-tag-value {<1-4095> | default}
ospf-manual-tag-value {<1-2147483647> | default}
# 일반 설정 / 비활성
set route-redistribution to ospf2 [instance <OSPF Instance>] off
set route-redistribution to ospf2 offOSPFv2 고유 파라미터는 다음과 같습니다(공통 파라미터는 BGP 절 표와 의미 동일).
| 파라미터 | 설명 | |||
|---|---|---|---|---|
| `[metric {<1-16777215> | default}] on` | OSPFv2로의 재분배 활성화. | ||
| `metric {<1-16777215> | default}` | (선택) 이 규칙으로 재분배되는 경로에 OSPFv2 metric 할당. OSPF의 metric은 cost 로, 목적지에 도달하는 데 필요한(대역폭에 따른) 오버헤드를 나타냄. cost가 높을수록 비쌈. 범위 1–16777215, 기본값 없음. | ||
| `from static-route {all-ipv4-routes | all-ipv6-routes | default | default6}` | 정적 경로를 OSPFv2로 재분배. |
| `from nat-pool {all-ipv4-routes | <IPv4 …>}` | NAT Pool 재분배(IPv4). | ||
| `ospf-automatic-tag {off | on}` | BGP AS 기반 자동 OSPF route 태그 사용 여부. on이면 export 시 external OSPF 경로에 태그 부착. 기본값 off. | ||
| `ospf-automatic-tag-value {<1-4095> | default}` | 자동 생성된 OSPF route 태그 값 수정. 범위 1–4095, 기본값 없음. | ||
| `ospf-manual-tag-value {<1-2147483647> | default}` | external OSPF route 태그 필드에 넣을 값. 범위 1–2147483647, 기본값 없음. |
예제
# eth2의 모든 IPv4 경로를 OSPFv2로 재분배
set route-redistribution to ospf2 from interface eth2 on
# eth0의 모든 경로를 OSPFv2로 재분배하고 metric 50 부여
set route-redistribution to ospf2 from interface eth0 metric 50 on
# AS 100의 모든 IPv4 경로를 OSPF로 재분배하고 cost 99 부여 (OSPFv2 전용)
set route-redistribution to ospf2 from bgp-as-number 100 all-ipv4-routes metric 99 on
# AS 100의 IPv4 경로를 OSPF로 재분배하되 192.168.0.0/16은 제외
set route-redistribution to ospf2 from bgp-as-number 100 network 192.168.0.0/16 action restrict
set route-redistribution to ospf2 from bgp-as-number 100 all-ipv4-routes onIPv4 Route Redistribution to RIP
RIP로 export하는 정책입니다. 명령·조회:
set route-redistribution to rip[Esc][Esc]
show configuration route-redistribution[Esc][Esc]RIP는 metric이 hop count(1–16) 이고, 재분배 시 metric 지정이 필수 라는 점이 핵심입니다. 소스로는 Interface, Static, Aggregate, Kernel, OSPFv2, OSPFv2 External, BGP Based on AS-Path, BGP Based on AS, NAT Pool을 쓸 수 있고, OSPF·BGP 소스에서는 riptag 를 지정할 수 있습니다.
# 예: RIP from OSPFv2
set route-redistribution to rip from ospf2 [instance <OSPF Instance>]
all-ipv4-routes
metric <1-16> on
off
network <IPv4 Address>/<Mask Length>
action {accept | restrict}
match-type {exact | normal | range between <Start> and <End> | refines} on
metric <1-16> on
off
riptag {<1-65535> | default}
# 일반 설정
set route-redistribution to rip offRIP 고유 파라미터:
| 파라미터 | 설명 | |
|---|---|---|
metric <1-16> | 이 규칙으로 재분배되는 경로에 RIP metric 부여. RIP/RIPng의 metric은 hop count 로 목적지까지의 거리를 나타냄. hop count가 높을수록 비쌈. metric이 16 이상이면 도달 불가(unreachable)로 취급 되어 설치·전파되지 않음. | |
metric <1-16> on | RIP로의 재분배 활성화. | |
all-ipv4-routes metric <1-16> on / all-ipv4-routes off | 모든 IPv4 경로 재분배 활성 / 비활성. | |
network <Addr>/<Mask> metric <1-16> on / off | 지정 네트워크 경로 재분배 활성 / 비활성. | |
| `from static-route {all-ipv4-routes | default}` | 정적 경로 재분배(RIP은 IPv4 전체 또는 기본 경로만). |
| `riptag {<1-65535> | default}` | 이 규칙으로 RIP에 재분배되는 경로에 route 태그 부여. 범위 1–65535, 기본값 없음. |
set route-redistribution to rip off | 이 프로토콜로의 모든 재분배 비활성. |
예제
# RIP의 192.168.0.0/16 중 마스크 18~24 범위 경로를 OSPF로 재분배
set route-redistribution to ospf2 from rip network 192.168.0.0/16 match-type range between 18 and 24 on
# 모든 OSPF external 경로를 RIP로 재분배하고 cost 2 부여
set route-redistribution to rip from ospf2ase all metric 2 on
# 모든 OSPF external 경로를 RIP로 재분배하고 RIP 태그 20 부여
set route-redistribution to rip from ospf2ase riptag 20
# 집약 경로 1.2.0.0/16을 RIP로 재분배하고 cost 2 부여
set route-redistribution to rip from aggregate 1.2.0.0/16 metric 2 on
# OSPF의 192.168.0.0/16 경로를 RIP로 재분배하고 cost 2 부여
set route-redistribution to rip from ospf2 network 192.168.0.0/16 metric 2 on
# external OSPFv2의 192.168.0.0/16 경로를 RIP로 재분배하고 metric 3 부여
set route-redistribution to rip from ospf2ase network 192.168.0.0/16 metric 3 on
# BGP AS 100에서 배운 모든 IPv4 경로를 RIP로 재분배하고 RIP 태그 99 부여
set route-redistribution to rip from bgp-aspath ^100_ origin any riptag 99
# BGP AS 100에서 시작되어 IGP로 배운 192.168.0.0/16 경로를 RIP로 재분배하고 cost 10 부여
set route-redistribution to rip from bgp-aspath _100$ origin IGP network 192.168.0.0/16 metric 10 onGaia Clish에서 IPv6 Route Redistribution 구성하기
IPv6 재분배의 명령·조회와 일반 구문은 다음과 같습니다.
set ipv6 route-redistribution[Esc][Esc]
show configuration ipv6 route-redistribution[Esc][Esc]
set ipv6 route-redistribution to <Destination Protocol> <Destination Protocol Parameters> from <Source Protocol> <Source Protocol Parameters>- 대상 옵션 — OSPFv3, RIPng.
- 소스 옵션 — BGP, OSPFv3, OSPFv3 External, RIPng, NAT Pools.
- 그 밖에 특정 인터페이스 경로, 정적 경로 도 재분배할 수 있습니다.
IPv6 Route Redistribution to OSPFv3
명령·조회:
set ipv6 route-redistribution to ospf3[Esc][Esc]
show configuration ipv6 route-redistribution[Esc][Esc]소스별 구문은 to ospf3 [instance <OSPF Instance>] 대상에 metric 범위 {<1-16777215> | default} 를 쓰는 점만 빼면 IPv4 OSPFv2와 같은 패턴입니다(단 range 매칭 없음). 소스로는 Interface, Static, Kernel, RIPng, OSPFv3, OSPFv3 External, BGP Based on AS-Path, BGP Based on AS, NAT Pool을 쓸 수 있습니다.
# 일반 설정
set ipv6 route-redistribution to ospf3 offOSPFv3 고유 파라미터는 다음과 같습니다.
| 파라미터 | 설명 | |
|---|---|---|
| `[metric {<1-16777215> | default}] on` | OSPFv3로의 재분배 활성화. |
| `metric {<1-16777215> | default}` | (선택) OSPFv3 metric 할당. OSPF의 metric은 cost(대역폭 오버헤드). 범위 1–16777215, 기본값 없음. |
| `from static-route {all-ipv6-routes | default6}` | 정적 경로 재분배(IPv6 전체 또는 기본 IPv6). |
| `from nat-pool {all-ipv6-routes | <IPv6 …>}` | NAT Pool 재분배(IPv6). |
from bgp-as-number / bgp-as-path / interface / kernel / ospf3 / ospf3ase / ripng | 각각 AS Number/AS-Path 기준 BGP, 인터페이스, 커널, OSPFv3, OSPFv3 External, RIPng 경로 재분배. | |
set ipv6 route-redistribution to ospf3 off | 이 프로토콜로의 모든 재분배 비활성. |
예제
# 기본 IPv6 정적 경로를 OSPFv3로 재분배하고 cost 15000 부여
set route-redistribution to ospf3 from static-route default metric 15000 on
# eth0의 모든 IPv6 경로를 OSPFv3로 재분배하고 cost 10 부여
set ipv6 route-redistribution to ospf3 from interface eth0 metric 10 on
# RIPng의 fd14:8502:5b14:456a::/64 네트워크(그 안의 주소 경로 포함)를 OSPFv3로 재분배
set ipv6 route-redistribution to ospf3 from rip network fd14:8502:5b14:456a::/64 match-type normal onIPv6 Route Redistribution to RIPng
명령·조회:
set ipv6 route-redistribution to ripng[Esc][Esc]
show configuration ipv6 route-redistribution[Esc][Esc]RIPng도 RIP처럼 metric이 hop count(1–16) 이고 재분배 시 metric 지정이 필수입니다. 소스로는 Interface, Static, Kernel, OSPFv3, OSPFv3 External, BGP Based on AS-Path, BGP Based on AS, NAT Pool을 쓸 수 있습니다.
# 예: RIPng from OSPFv3
set ipv6 route-redistribution to ripng from ospf3 [instance <OSPF Instance>]
all-ipv6-routes
metric <1-16> on
off
network <IPv6 Address>/<Mask Length>
action {accept | restrict}
match-type {exact | normal | refines} on
metric <1-16> on
off
# 일반 설정
set ipv6 route-redistribution to ripng offRIPng 고유 파라미터:
| 파라미터 | 설명 | |
|---|---|---|
metric <1-16> | RIPng metric 부여. hop count이며 16 이상은 도달 불가 로 취급되어 설치·전파되지 않음. | |
metric <1-16> on | RIPng로의 재분배 활성화. | |
all-ipv6-routes metric <1-16> on / off | 모든 IPv6 경로 재분배 활성 / 비활성. | |
network <IPv6 …> metric <1-16> on / off | 지정 네트워크 경로 재분배 활성 / 비활성. | |
| `from static-route {all-ipv6-routes | default6}` | 정적 경로 재분배(IPv6 전체 또는 기본 IPv6). |
set ipv6 route-redistribution to ripng off | 이 프로토콜로의 모든 재분배 비활성. |
예제
# 모든 OSPFv3 External 경로를 RIPng로 재분배하고 cost 22 부여
set ipv6 route-redistribution to ripng from ospf3ase all metric 22 on
# OSPFv3의 fd14:8502:5b14:456a::/64 경로를 RIPng로 재분배하고 cost 999 부여
set ipv6 route-redistribution to ripng from ospf3 network fd14:8502:5b14:456a::/64 metric 999 on
# OSPFv3 External의 fd14:8502:5b14:456a::/64 경로는 RIPng로 재분배하지 않음
set ipv6 route-redistribution to ripng from ospf3ase network fd14:8502:5b14:456a::/64 action restrict---
Route Maps — 가장 강력한 경로 제어 도구
Route Map 은 IPv4·IPv6 모두를 지원하며 RIP, RIPng, BGP, OSPFv2, OSPFv3에 쓸 수 있습니다. BGP-4 Multiprotocol Extensions 정책은 오직 route map으로만 정의 할 수 있습니다. 다른 프로토콜에서는 route map을 쓰거나, 앞서 본 Route Redistribution·Inbound Route Filter 기능을 쓸 수 있습니다.
각 route map은 판단 기준(match)과 동작(action) 문(statement)의 목록 으로 이루어집니다. inbound·outbound·redistribution 경로에 적용할 수 있고, 경로는 match 기준과 비교되어 모든 기준에 맞는 경로에만 정의된 action이 적용 됩니다. match 기준은 순서에 상관없이 설정할 수 있으며, match 기준을 하나도 정의하지 않으면 route map은 모든 경로에 매칭 됩니다. route map을 정의한 다음, 그 프로토콜의 export 또는 import 정책에 할당합니다.
route map은 이름(name)과 번호(ID), Allow/Restrict 절, match·set 문의 모음 으로 식별됩니다. 같은 이름에 다른 ID를 가진 인스턴스가 여러 개 있을 수 있습니다. 가장 낮은 번호의 인스턴스가 먼저 검사 되며, 한 인스턴스의 모든 기준이 매칭되거나 모든 인스턴스가 소진되면 처리가 멈춥니다. 기준이 매칭되면 해당 섹션의 action이 실행됩니다. 라우팅 프로토콜은 각 route map에 분명한 preference 값을 설정 하면 둘 이상의 route map을 쓸 수 있고, preference 값이 가장 낮은 route map이 먼저 검사 됩니다.
Route Map 구성 명령
쓸 수 있는 명령과 현재 구성을 보려면:
set routemap[Esc][Esc]
show routemaps
show routemap <Name of Route Map> {all | id <1-65535>}match 조건 구문
set routemap <Name of Route Map> id {<1-65535> | default} match
as <BGP AS Number> {off | on}
aspath-regex {empty | <Regular Expression>} origin {any | egp | igp | incomplete}
community
<Community ID> as <Community AS Number 1-65535> {off | on}
exact {off | on}
no-advertise {off | on}
no-export {off | on}
no-export-subconfed {off | on}
none {off | on}
community-regex {empty | <Regular Expression>}
ifaddress <IPv4 or IPv6 Address of Interface> {off | on}
interface <Name of Interface> {off | on}
metric value <Metric>
neighbor <IPv4 or IPv6 Address of Network> {off | on}
network <IPv4 or IPv6 Address of Interface>/<Mask Length>
all [restrict {off | on}]
between <Start Mask Length> and <End Mask Length> [restrict {off | on}]
exact [restrict {off | on}]
off
refines [restrict {off | on}]
nexthop <IPv4 or IPv6 Address of Next Hop Gateway> {off | on}
ospf-instance <OSPF Instance> {off | on}
prefix-list <Prefix List>
off
preference <1-255> invert {off | on}
preference <1-255> on
prefix-tree <Prefix Tree>
off
preference <1-255> invert {off | on}
preference <1-255> on
protocol <Protocol>
remove {as | aspath-regex | community | community-regex | ifaddress | interface | metric | neighbor | network | nexthop | ospf-instance | prefix-list | prefix-tree | protocol | route-type | tag}
route-type {type-1 | type-2 | inter-area | intra-area} {off | on}
tag <1-4294967295> {off | on}주요 match 파라미터는 다음과 같습니다.
| 파라미터 | 설명 | ||||
|---|---|---|---|---|---|
| `match as <BGP AS Number> {off | on}` | 지정 BGP AS 번호로부터 받거나 그쪽으로 광고하는 경로만 매칭. 한 ID에 여러 AS 조건 가능(하나라도 맞으면 매칭). BGP의 import/export route map에만 적용. 범위 1–4294967295 또는 65535.65535. | |||
| `match aspath-regex {empty | <RegEx>} origin {…}` | BGP AS Path에 매칭되는 정규표현식과 route origin 구성(연산자·origin은 앞 표 참고). | |||
| `match community <Community ID> as <AS> {off | on}` | 지정 Community ID와 AS 번호 속성을 가진 BGP 경로 매칭. | |||
| `match community exact {off | on}` | 구성한 Community 집합이 BGP Communities 속성 전체와 정확히 일치 하는지 매칭. 먼저 match community <ID> as <AS> on 으로 Community 문자열을 추가해야 함. | |||
| `match community no-advertise {off | on}` | BGP Communities 속성에 No-Advertise 가 설정된 경로 매칭(어떤 BGP 피어에도 광고되지 않는 경로). | |||
| `match community no-export {off | on}` | No-Export 가 설정된 경로 매칭(BGP Confederation 경계 밖으로 export되지 않음. 독립 AS에도 적용). | |||
| `match community no-export-subconfed {off | on}` | No-Export-Subconfed 가 설정된 경로 매칭(BGP AS 밖으로 export되지 않음. Confederation에서는 다른 Routing Domain Identifier 라우터로 export 안 됨). | |||
| `match community none {off | on}` | 비어 있는(empty) BGP Communities 속성 을 가진 경로 매칭. | |||
| `match community-regex {empty | <RegEx>}` | BGP Community에 매칭되는 정규표현식 구성(연산자는 AS_PATH 정규표현식과 동일). | |||
| `match ifaddress <IP> {off | on}` | 경로를 받은 인터페이스의 IP 주소와 매칭. 동적 라우팅으로 받은 경로에만 적용 되고 그 외에는 무시(예: 정적 경로는 이 조건과 무관하게 매칭). import·export route map 모두에 적용. | |||
| `match interface <Name> {off | on}` | 지정 인터페이스 이름과 매칭. import·export 모두 적용. | |||
match metric value <Metric> | 특정 metric을 가진 경로 매칭. RIP/RIPng: RIP metric(1–65535, 16 이상은 unreachable), OSPF/OSPFv3: route cost(0–65535), BGP: MED(0–4294967295). | ||||
| `match neighbor <IP> {off | on}` | 지정 이웃에서 온 경로 매칭. BGP·RIP에서, import route map에서만 적용. 한 ID에 여러 neighbor 가능. | |||
match network <Addr>/<Mask> 및 `all / between … / exact / refines [restrict {off | on}]` | 지정 IPv4/IPv6 서브넷 기준 매칭. all(같거나 포함), between(마스크 범위), exact(정확히 일치), refines(포함되되 더 구체적). restrict on 은 매칭 서브넷의 export/import를 막고, off 는 허용. match network … off 는 조건 제거. | |||
| `match nexthop <IP> {off | on}` | 지정 next hop 게이트웨이 주소를 가진 경로 매칭. 한 ID에 여러 개 가능(하나라도 맞으면 매칭). export route map으로 BGP/RIP/OSPF 경로를 export할 때만 적용. | |||
| `match ospf-instance <OSPF Instance> {off | on}` | 특정 OSPF 인스턴스에서 배운 경로 매칭(OSPF 경로에만 영향). | |||
match prefix-list <Prefix List> 및 `preference <1-255> [invert {off | on}] on / off` | 지정 Prefix List와 매칭. 각 경로를 prefix list의 정책에 따라 수용/거부. 여러 prefix list는 preference 낮은 것부터 고려. 한 ID는 Prefix List, Prefix Tree, Network 중 하나만 매칭 가능. invert on 은 prefix의 Accept/Restrict를 뒤집음. | |||
match prefix-tree <Prefix Tree> 및 `preference <1-255> [invert {off | on}] on / off` | 지정 Prefix Tree와 매칭(위 prefix-list와 동일한 규칙·옵션). | |||
match protocol <Protocol> | 지정 프로토콜 유형의 경로 매칭(프로토콜 간 재분배에 사용). 값: aggregate, bgp, direct(인터페이스 경로), kernel, ospf2, ospf2ase, ospf3, ospf3ase, rip, ripng, static. | ||||
| `match route-type {type-1 | type-2 | inter-area | intra-area} {off | on}` | 지정 OSPF route 유형 매칭. export route map으로 OSPFv2/OSPFv3 경로를 export할 때만 적용. inter-area·intra-area면 match protocol ospf2, type-1·type-2면 match protocol ospf2ase 를 함께 구성. (route-type action 과 동시에 쓸 수 없음.) |
| `match tag <1-4294967295> {off | on}` | 지정 태그 값을 가진 OSPF external 경로 매칭. 현재는 OSPF→BGP export에만 사용 가능. | |||
match remove <항목> | as, aspath-regex, community, community-regex, ifaddress, interface, metric, neighbor, network, nexthop, ospf-instance, prefix-list, prefix-tree, protocol, route-type, tag 등의 match 조건을 이 ID에서 제거. |
action 구문
set routemap <Name of Route Map> id {<1-65535> | default} action
aspath-prepend-count <1-25>
community
<Community ID> as <Community AS Number 1-65535> {off | on}
append {off | on}
delete {off | on}
no-advertise {off | on}
no-export {off | on}
no-export-subconfed {off | on}
none {off | on}
replace {off | on}
localpref <0-65535>
metric
add <1-4294967295>
igp add <1-4294967295>
igp subtract <1-4294967295>
subtract <1-4294967295>
value <0-4294967295>
nexthop
ip <IPv4 Address of Next Hop Gateway>
ipv6 <IPv6 Address of Next Hop Gateway>
ospfautomatictag <0-4095>
ospfmanualtag <1-4294967295>
precedence <0-65535>
preference <0-65535>
remove {aspath-prepend-count | community | localpref | metric | nexthop ip | nexthop ipv6 | ospfautomatictag | ospfmanualtag | precedence | preference | riptag | route-type}
riptag <1-65535>
route-type {type-1 | type-2}주요 action 파라미터:
| 파라미터 | 설명 | |
|---|---|---|
action aspath-prepend-count <1-25> | route map에 매칭된 경로를 BGP로 광고할 때 로컬 AS 번호를 AS path 앞에 지정 횟수만큼 덧붙임(prepend). BGP에만, export route map에만 적용. | |
| `action community <ID> as <AS> {off | on}` | 지정 Community ID·AS를 Community Action List에 추가. |
| `action community append {off | on}` | Community Action List의 Community를 BGP Communities 속성에 덧붙임. |
| `action community delete {off | on}` | Action List의 Community를 기존 BGP Communities 속성에서 삭제. |
| `action community no-advertise {off | on}` | 특수 Community NO_ADVERTISE(65535:65282) 를 추가(어떤 BGP 피어에도 광고 안 됨). |
| `action community no-export {off | on}` | NO_EXPORT(65535:65281) 추가(Confederation 경계 밖 export 안 됨, 독립 AS에도 적용). |
| `action community no-export-subconfed {off | on}` | NO_EXPORT_SUBCONFED(65535:65283) 추가(BGP AS 밖 export 안 됨). |
| `action community none {off | on}` | 기존 속성과 무관하게 BGP Community 속성을 보내지 않음. |
| `action community replace {off | on}` | Action List의 Community로 기존 모든 Community를 교체. Action List가 비어 있으면 속성은 그대로 유지. |
action localpref <0-65535> | 매칭된 iBGP 경로의 local preference 구성. iBGP에만, import route map에만 적용. | |
action metric add <1-4294967295> | 매칭 경로의 metric을 지정량만큼 증가. OSPF/OSPFv3·RIP/RIPng를 BGP로 export하거나 RIP/RIPng를 import할 때만 효과. (BGP export: 0–4294967295, RIP import: 1–65535(16↑ unreachable), OSPF import: 0–65535.) | |
action metric igp add <1-4294967295> / igp subtract <…> | metric을 RIP metric 값으로 설정한 뒤 상수를 더함/뺌. OSPF/RIP를 BGP로 export할 때만 효과. 결과 범위 0–4294967295. | |
action metric subtract <1-4294967295> | 매칭 경로의 metric을 지정량만큼 감소. 적용 조건·범위는 add 와 동일. | |
action metric value <0-4294967295> | 매칭 경로의 metric을 지정 값으로 설정. RIP/RIPng export: RIP metric(1–65535, 16↑ unreachable), OSPFv2/v3 export: route cost(0–65535), BGP export: MED(0–4294967295). export route map에만 적용. | |
action nexthop ip <IPv4> / nexthop ipv6 <IPv6> | 매칭 BGP 경로의 next hop 주소 구성(link-local 주소 불가). BGP import/export에만 적용. route reflector로 동작할 때는 iBGP에서 배워 내부 BGP 피어로 export하는 경로의 next hop은 바뀌지 않음. | |
action ospfautomatictag <0-4095> | route map에 매칭된 OSPF external 경로의 자동 태그 구성. 비OSPF 경로를 OSPF로 export할 때만 적용(RFC 1403 참고). | |
action ospfmanualtag <1-4294967295> | OSPF external 경로의 수동 태그 구성. 비OSPF 경로를 OSPF로 export할 때만 적용. | |
action precedence <0-65535> | 매칭 경로의 precedence 구성. 같은 경로가 여러 소스(여러 프로토콜)에서 커널 라우팅 테이블로 들어올 때 precedence를 비교해 우선 경로를 결정. 값이 낮을수록 우선, 비선호 경로는 inactive로 표시되어 설치 안 됨. import route map에만 적용. | |
action preference <0-65535> | 매칭 경로의 BGP preference 구성. BGP 광고로 받은 경로에만 적용. Cisco의 weight에 해당하나 값이 낮을수록 선호(Cisco와 반대). weight가 있는 경로가 없는 경로보다 선호됨. 로컬 라우터에만 적용. | |
action riptag <1-65535> | 매칭된 external 경로의 RIP 태그 구성. | |
| `action route-type {type-1 | type-2}` | 비RIP 경로를 RIP로 export할 때만 적용(RFC 2453 참고). |
action remove <항목> | aspath-prepend-count, community, localpref, metric, nexthop ip/ipv6, ospfautomatictag, ospfmanualtag, precedence, preference, riptag, route-type 등의 action을 이 ID에서 제거. |
기타 route map 설정
set routemap <Name of Route Map> id {<1-65535> | default} allow
set routemap <Name of Route Map> id {<1-65535> | default} inactive
set routemap <Name of Route Map> id {<1-65535> | default} {off | on}
set routemap <Name of Route Map> id {<1-65535> | default} restrict| 파라미터 | 설명 | |
|---|---|---|
allow | 특별히 restrict되지 않은 모든 매칭 경로를 허용. | |
inactive | 이 route map ID를 비활성(재활성하려면 allow 또는 restrict). | |
| `{off | on}` | 이 route map ID 제거(off)/생성(on). 범위 1–65535, 기본값 10. |
restrict | 특별히 accept되지 않은 모든 경로를 거부. |
Route Map의 Export와 Import 할당
route map을 정의한 뒤에는 프로토콜에 import/export 정책으로 할당해야 합니다. 프로토콜별로 쓸 수 있는 명령을 둘러보려면 다음을 입력합니다.
set rip export-routemap[Esc][Esc]
set rip import-routemap[Esc][Esc]
set ipv6 ripng export-routemap[Esc][Esc]
set ipv6 ripng import-routemap[Esc][Esc]
set ospf export-routemap[Esc][Esc]
set ospf import-routemap[Esc][Esc]
set ipv6 ospf3 export-routemap[Esc][Esc]
set ipv6 ospf3 import-routemap[Esc][Esc]
set bgp external remote-as <BGP Peer AS Number> export-routemap[Esc][Esc]
set bgp external remote-as <BGP Peer AS Number> import-routemap[Esc][Esc]
set bgp external remote-as <BGP Peer AS Number> peer <Peer IP Address> export-routemap[Esc][Esc]
set bgp external remote-as <BGP Peer AS Number> peer <Peer IP Address> import-routemap[Esc][Esc]
set bgp internal export-routemap[Esc][Esc]
set bgp internal import-routemap[Esc][Esc]
set bgp internal peer <Peer IP Address> import-routemap[Esc][Esc]RIP·RIPng·OSPF·OSPFv3에 route map을 할당·해제하고 조회하는 구문은 다음과 같습니다.
set {ospf | ipv6 ospfv3 | rip | ipv6 ripng}
export-routemap <Name of Route Map> preference <1-65535> on
import-routemap <Name of Route Map> preference <1-65535> on
set {ospf | ospfv3 | rip | ipv6 ripng}
export-routemap <Name of Route Map> off
import-routemap <Name of Route Map> off
show {ospf | ospfv3 | rip | ipv6 ripng | bgp} routemapBGP의 export/import 정책에 route map을 설정하는 구문은 다음과 같습니다.
set bgp external remote-as <1-65535>
export-routemap <Name of Route Map>
off
preference <1-65535> [family {inet | inet6 | inet-and-inet6}] on
set bgp external remote-as <1-65535>
import-routemap <Name of Route Map>
off
preference <1-65535> [family {inet | inet6 | inet-and-inet6}] on
set bgp internal
export-routemap <Name of Route Map>
off
preference <1-65535> [family {inet | inet6 | inet-and-inet6}] on
set bgp internal
import-routemap <Name of Route Map>
off
preference <1-65535> [family {inet | inet6 | inet-and-inet6}] on할당 파라미터:
| 파라미터 | 설명 | ||
|---|---|---|---|
<Name of Route Map> | 구성된 route map의 이름. | ||
preference <1-65535> | export 정책에서 이 route map이 적용되는 순서. preference 값이 증가하는 순서로 평가 됨. | ||
| `family {inet | inet6 | inet-and-inet6}` | 이 route map을 매칭할 주소 패밀리를 제한. inet(IPv4만), inet6(IPv6만), inet-and-inet6(모든 경로). 기본값 inet. |
프로토콜별로 지원되는 Route Map 문
일부 문은 특정 프로토콜에만 효과가 있습니다. 예를 들어 AS 번호 매칭은 BGP에만 해당합니다. 적용되지 않는 match 조건이나 action은 무시되며 마치 없는 것처럼 처리되고, 그런 문에 대해서는 /var/log/messages 파일에 로그가 남습니다.
- RIP
- Import match 조건: Neighbor, Network, Interface, Ifaddress, Metric, Nexthop
- Import action: Precedence, Metric Add/Subtract
- Export match(RIP에서 export 시): Interface, Ifaddress, Metric, Network, Nexthop
- Export match(Protocol match로 재분배 시): 재분배되는 경로의 출처 프로토콜에 따름
- Export action(RIP에서 export 시): Metric Add/Subtract
- Export action(재분배 시): Metric Set
- OSPFv2 / OSPFv3
- Import match 조건: Network(Route Prefix)
- Import action: Precedence
- Export match(다른 프로토콜이 OSPF 경로를 재분배할 때): Network, Interface, Ifaddress, Metric, Route-type, Nexthop
- Export match(OSPF가 다른 프로토콜의 경로를 재분배할 때): 그 프로토콜이 지원하는 조건
- Export action(AS External로 재분배 시): Metric, Route-type
- BGP — 초기 구성 시:
- Router ID를 구성합니다(자세한 내용은 BGP Global Settings 참고).
- 라우터의 로컬 AS 번호를 구성합니다.
set as {<BGP AS Number> | off}
| 파라미터 | 설명 |
|---|---|
<BGP AS Number> | 라우터의 로컬 AS 번호. confederation 번호 및 routing domain identifier와 상호 배타적 — 라우터는 AS 번호 또는 confederation 번호 중 하나만 가질 수 있음. |
off | 구성된 로컬 AS 번호 비활성. |
Route Map 예제
예제 1 — eth3 인터페이스 경로를 OSPF로 재분배하고, OSPF route-type을 AS type-2, cost 20으로 설정.
set routemap direct-to-ospf id 10 on
set routemap direct-to-ospf id 10 match interface eth3
set routemap direct-to-ospf id 10 match protocol direct
set routemap direct-to-ospf id 10 action route-type type-2
set routemap direct-to-ospf id 10 action metric value 20
set ospf export-routemap direct-to-ospf preference 1 on예제 2 — RIP 이웃 192.0.2.3의 경로는 거부, 192.0.2.4의 경로는 그대로 수용, 나머지 모든 경로는 metric을 2 증가.
set routemap rip-in id 10 on
set routemap rip-in id 10 restrict
set routemap rip-in id 10 match neighbor 192.0.2.3
set routemap rip-in id 15 on
set routemap rip-in id 15 match neighbor 192.0.2.4
set routemap rip-in id 20 on
set routemap rip-in id 20 action metric add 2
set rip import-routemap rip-in preference 1 on예제 3 — 모든 정적 경로를 BGP AS group 400으로 재분배. MED를 100으로, 우리 AS 번호를 aspath에 4번 prepend. 경로가 prefix 192.0.2.0/8에 속하면 재분배하지 않음. aspath가 정규표현식 (100 200+)에 매칭되는 모든 BGP 경로를 보내며 MED를 200으로 설정.
set routemap static-to-bgp id 10 on
set routemap static-to-bgp id 10 restrict
set routemap static-to-bgp id 10 match protocol static
set routemap static-to-bgp id 10 match network 192.0.2.0/8 all
set routemap static-to-bgp id 15 on
set routemap static-to-bgp id 15 match protocol static
set routemap static-to-bgp id 15 action metric 100
set routemap static-to-bgp id 15 action aspath-prepend-count 4
set routemap bgp-out id 10 on
set routemap bgp-out id 10 match aspath-regex "(100 200+)" origin any
set routemap bgp-out id 10 action metric 200
set bgp external remote-as 400 export-routemap bgp-out preference 1 family inet on
set bgp external remote-as 400 export-routemap static-to-bgp preference 2 family inet on예제 4 — OSPFv2 경로를 한 인스턴스에서 다른 인스턴스로 재분배. "Intranet" route map은 prefix-list "Intranet"에서 OSPF instance default의 모든 OSPF 경로(match 문이 없으므로 OSPF에서 쓸 때만)와, 같은 prefix-list의 정적·direct·aggregate·kernel 경로를 매칭. OSPF로 export하므로 한 ID에는 match protocol OSPF가 필요 없고(자동 가정), OSPF2/OSPF2ASE는 이 ID에서 암묵적으로 매칭됨.
set routemap Intranet id 1 on
set routemap Intranet id 1 allow
set routemap Intranet id 1 match ospf-instance default on
set routemap Intranet id 1 match prefix-list Intranet preference 1 on
set routemap Intranet id 11 on
set routemap Intranet id 11 match prefix-list Intranet preference 1 on
set routemap Intranet id 11 match protocol static
set routemap Intranet id 12 on
set routemap Intranet id 12 match prefix-list Intranet preference 1 on
set routemap Intranet id 12 match protocol direct
set routemap Intranet id 13 on
set routemap Intranet id 13 match prefix-list Intranet preference 1 on
set routemap Intranet id 13 match protocol aggregate
set routemap Intranet id 14 on
set routemap Intranet id 14 match prefix-list Intranet preference 1 on
set routemap Intranet id 14 match protocol kernel예제 5 — 모든 OSPFv3(내부·외부) 경로를 BGP group 400으로 재분배. 나가는 community 문자열을 'no-export, 200 as 100'으로 설정. BGP IPv6 경로는 빈 community로 전송. 모든 경로의 nexthop 값을 3003::abcd:1012(피어 연결 인터페이스 주소)로 설정.
set routemap ospf3-to-bgp id 10 on
set routemap ospf3-to-bgp id 10 match protocol ospf3 #OSPF3 INTERNAL ROUTES
set routemap ospf3-to-bgp id 10 action community replace on
set routemap ospf3-to-bgp id 10 action community no-export on
set routemap ospf3-to-bgp id 10 action community 200 as 100 on
set routemap ospf3-to-bgp id 10 action nexthop ipv6 3003::abcd:1012
set routemap ospf3-to-bgp id 20 on
set routemap ospf3-to-bgp id 20 match protocol ospf3ase #FOR AS EXTERNAL ROUTES
set routemap ospf3-to-bgp id 20 action community replace on
set routemap ospf3-to-bgp id 20 action community no-export on
set routemap ospf3-to-bgp id 20 action community 200 as 100 on
set routemap ospf3-to-bgp id 10 action nexthop ipv6 3003::abcd:1012
set routemap bgp-out id 10 on
set routemap bgp-out id 10 action community replace on
set routemap bgp-out id 10 action community none on
set routemap ospf3-to-bgp id 10 action nexthop ipv6 3003::abcd:1012
set bgp external remote-as export-routemap bgp-out preference 1 family inet6 on
set bgp external remote-as export-routemap ospf3-to-bgp preference 2 family inet6 on예제 6 — OSPFv2 인스턴스의 경로를 BGP로 재분배.
set routemap OSPF-to-BGP id 10 on
set routemap OSPF-to-BGP id 10 allow
set routemap OSPF-to-BGP id 10 match ospf-instance 222 on
set routemap OSPF-to-BGP id 10 match protocol ospf2예제 7 — OSPFv3 인스턴스의 경로를 BGP로 재분배.
set routemap OSPF-to-BGP id 10 on
set routemap OSPF-to-BGP id 10 allow
set routemap OSPF-to-BGP id 10 match ospf-instance 222 on
set routemap OSPF-to-BGP id 10 match protocol ospf3---
Prefix List와 Prefix Tree — 매칭할 prefix 묶음 정의하기
사용자는 prefix list나 prefix tree를 만들어 route map이 그 목록을 allow하거나 reject 하도록 구성할 수 있습니다. 둘의 차이는 매칭 방식에 있습니다.
| 종류 | 설명 |
|---|---|
| Prefix List | 순차 조회(sequential lookup)를 흉내 내어 처음 일치한 항목을 진짜 매칭 으로 반환합니다. 이름은 최대 16자, 글자·숫자·-·_·. 만 사용할 수 있습니다. |
| Prefix Tree | 가장 긴 일치(longest match)를 진짜 매칭 으로 반환합니다. |
Prefix List 구문
주어진 sequence 번호에 prefix를 구성합니다.
set prefix-list <Name of Prefix List>
sequence-number <1-4294967295>
prefix <IP Address>/<Mask Length>
all [restrict {off | on}]
between <Start Mask Length> and <End Mask Length> [restrict {off | on}]
exact [restrict {off | on}]
refines [restrict {off | on}]sequence 번호를 prefix list에서 제거하거나 prefix list를 비활성하려면:
set prefix-list <Name of Prefix List> sequence-number <1-4294967295> off
set prefix-list <Name of Prefix List> off예제 1 — non-local prefix list로 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12는 restrict하되 나머지 모든 IPv4 prefix는 허용.
set prefix-list non-local sequence-number 5 prefix 10.0.0.0/8 all restrict on
set prefix-list non-local sequence-number 10 prefix 192.168.0.0/16 all restrict on
set prefix-list non-local sequence-number 15 prefix 172.16.0.0/12 all restrict on
set prefix-list non-local sequence-number 20 prefix 0.0.0.0/0 all예제 2 — no-5-net prefix list로 5.0.0.0/8은 restrict하되 다른 모든 /8 prefix는 허용. 그 외 prefix는 이 목록에 매칭되지 않음(따라서 다른 prefix list가 매칭하지 않는 한 restrict됨).
set prefix-list no-5-net sequence-number 1 prefix 5.0.0.0/8 exact restrict on
set prefix-list no-5-net sequence-number 2 prefix 0.0.0.0/0 between 8 and 8Prefix Tree 구문
prefix를 구성합니다.
set prefix-tree <Name of Prefix Tree>
prefix <IP Address>/<Mask Length>
all [restrict {off | on}]
between <Start Mask Length> and <End Mask Length> [restrict {off | on}]
exact [restrict {off | on}]
refines [restrict {off | on}]prefix tree에서 prefix를 제거하거나 prefix tree를 비활성하려면:
set prefix-tree <Name of Prefix Tree> prefix <IP Address>/<Mask Length> off
set prefix-tree <Name of Prefix Tree> off예제 1 — non-local prefix tree로 마스크 길이가 /8 이하인 모든 prefix와 192.168.0.0/16, 172.16.0.0/12는 restrict하되 나머지 모든 IPv4 prefix는 허용.
set prefix-tree non-local prefix 0.0.0.0/0 between 0 and 8 restrict on
set prefix-tree non-local prefix 0.0.0.0/0 between 9 and 32
set prefix-tree non-local prefix 192.168.0.0/16 all restrict on
set prefix-tree non-local prefix 172.16.0.0/12 all restrict on예제 2 — 10-net prefix tree로 10.1.1.0/24는 허용, 10.1.0.0/16의 모든 하위 prefix는 restrict, 10.0.0.0/8의 모든 하위 prefix(10.0.0.0/8 자체는 제외)는 허용. 그 외 prefix는 이 목록에 매칭되지 않음(따라서 다른 prefix tree가 매칭하지 않는 한 restrict됨).
set prefix-tree 10-net prefix 10.0.0.0/8 refines
set prefix-tree 10-net prefix 10.1.0.0/16 all restrict
set prefix-tree 10-net prefix 10.1.1.0/24 exact---
정리하면, Route Aggregation은 여러 경로를 하나로 묶어 테이블을 단순화하고, Inbound Route Filter는 받을 경로를 거르며, Route Redistribution은 한 프로토콜의 경로를 다른 프로토콜로 내보내고, Route Map은 prefix-list/prefix-tree와 함께 가장 정교한 매칭·속성 변경을 제공 합니다. Portal 옵션으로 충분한 일은 Portal에서, 더 세밀한 제어가 필요하면 Gaia Clish의 route map으로 다루되, route map은 Portal 설정을 덮어쓰고 BGP Confederation에서는 쓸 수 없다 는 두 가지 제약을 항상 기억하면 됩니다.