이 페이지 내용
cRPD의 레이어 3 오버레이 지원
개요
가상 라우팅 및 포워딩(VRF) 인스턴스는 오버레이 기능을 제공하기 위해 MPLS 및 멀티프로토콜 BGP(Border Gateway Protocol) 지원과 함께 cRPD에서 지원됩니다.
라우팅 인스턴스는 라우팅 테이블, 인터페이스 및 라우팅 프로토콜 매개 변수의 집합입니다. 레이어 3 VPN을 구현하려면 각 VPN에 대해 하나의 라우팅 인스턴스를 구성합니다. VRF는 Linux 커널의 네트워크 디바이스이며 디바이스는 와 연결되어 table-id
있습니다. PE 라우터에서만 라우팅 인스턴스를 구성합니다. Linux 네트워크에서 VRF를 생성할 수 있습니다. VRF 디바이스 구현은 레이어 3 이상에만 영향을 미칩니다. 각 VPN 라우팅 인스턴스는 다음과 같은 구성 요소로 구성됩니다.
VRF 테이블 - 각 PE 라우터에서 각 VPN에 대해 하나의 VRF 테이블을 구성합니다.
정책 규칙 - VRF 테이블에서 경로로 경로 가져오기 및 내보내기를 제어합니다.
CE 라우터에서 VRF 테이블로 경로를 설치하는 하나 이상의 라우팅 프로토콜 - BGP, OSPF 및 RIP 라우팅 프로토콜과 정적 경로를 사용할 수 있습니다.
VRF 디바이스가 생성되면 라우팅 테이블과 연결됩니다. 노예화된 디바이스를 통해 VRF로 들어오는 패킷은 VRF 디바이스와 연결된 라우팅 테이블에서 조회됩니다. 마찬가지로, 송신 라우팅 규칙은 실제 인터페이스에서 패킷을 전송하기 전에 VRF 드라이버로 패킷을 전송하는 데 사용됩니다.
VRF는 VRF의 독립 포워딩 테이블을 기반으로 경로를 관리하고 트래픽을 포워딩하는 데 사용됩니다. RPD는 유형의 vrf
모든 라우팅 인스턴스에 대해 여러 개의 라우팅 테이블을 생성합니다. 테이블은 각 패밀리 주소에 대해 하나씩 있습니다. VPN에 참여하는 각 PE 라우터에서 각 VPN에 대한 라우팅 인스턴스를 구성해야 합니다. 계층을 [edit routing-instances]
사용하여 라우팅 인스턴스를 구성할 수 있습니다. 유형의 vrf
라우팅 인스턴스는 cRPD에서만 지원됩니다.
계층을 사용하는 VRF 아래에 BFD, BGP, IS-IS(Intermediate System to Intermediate System), OSPF 버전 2(OSPF라고 함), OSPF 버전 3(OSPFv3) 및 ICMP 라우터 검색의 [edit routing-instances routing-instance-name protocols]
여러 인스턴스를 생성할 수 있습니다. 계층을 사용하여 프로토콜 독립 라우팅을 edit routing-instances instance-name routing-options
구성할 수 있습니다.
레이어 3 오버레이는 cRPD에서 다음과 같은 터널링 프로토콜을 지원합니다.
inet.3의 정적 경로
BGP labeled unicast
GRE 터널링
MPLS 정적 LSP
programmable-rpd API를 사용하여 프로그래밍된 경로
MPLS 지원 인터페이스의 direct-ebgp-peering
VRF에서 인터페이스 구성
디바이스의 노예화는 RPD에 의해 수행됩니다. 즉, 라우팅 인스턴스에서 구성된 인터페이스는 커널로 전송된 넷링크 메시지를 사용하여 RPD에 의해 vrf-device로 마이그레이션(노예화)됩니다.
인터페이스가 유형 vrf
의 라우팅 인스턴스 아래에 구성된 경우, 이러한 링크가 커널에서 학습되고 링크가 올바른 테이블에 연결되어 있지 않은 경우 RPD는 링크를 슬레이브화하기 위해 넷링크 알림을 보냅니다. 링크가 존재하지 않거나 RPD가 링크에 대해 학습하지 않은 경우 링크가 생성되거나 RPD가 이에 대해 학습할 때마다 링크는 구성에 따라 올바르게 슬레이브됩니다.
예: cRPD 인스턴스에서 레이어 3 VPN(VRF) 구성
이 예시는 VRF 테이블에서 경로로 경로 가져오기 및 내보내기를 제어하고 BGP labeled unicast를 사용하여 학습된 다음 홉으로 PE 라우터를 구성하여 PE 라우터 및 경로 리플렉터에서 VPNv4 경로 확인을 보여줍니다. 이 예에서 트래픽은 CE1에서 CE2로 흐릅니다.
요구 사항
이 예에서 사용되는 하드웨어 및 소프트웨어 구성 요소는 다음과 같습니다.
-
Ubuntu 소프트웨어 버전 18.04
-
Linux 커널 버전 4.5 이상
-
cRPD 소프트웨어 릴리스 버전 19.4R1 이상
레이어 3 VPN(VRF)을 구성하기 전에 기본 구성 요소를 설치해야 합니다.
-
cRPD 인스턴스가 생성된 호스트 OS의 MPLS 모듈. 자세한 내용은 호스트 OS에서 설정 구성하기를 참조하십시오.
-
프로바이더 에지 라우터(PE1), 프로바이더 라우터(P) 및 프로바이더 에지 라우터(PE2)입니다. 설치에 대한 자세한 내용은 Docker에 cRPD 설치를 참조하세요.
개요
VPNv4 경로 확인을 구성하려면 VPN에 참여하는 각 PE 라우터에서 각 VPN에 대한 유형 VRF의 라우팅 인스턴스를 구성하고 정적 경로를 추가해야 합니다. 문은 static
라우팅 테이블에 vrfblue.inet.0
설치된 정적 경로를 구성합니다. Linux 커널에서 생성된 모든 VRF 디바이스에 대한 루프백 인터페이스 또는 디바이스는 없습니다. 그러나 루프백 호스트 주소는 RPD에서 학습할 수 있는 VRF 디바이스에 직접 추가됩니다.
구성
BGP LU로 PE1 라우터 구성하기
단계별 절차
다음 예제에서는 구성 계층에서 다양한 수준의 탐색이 필요합니다.
-
mpls.0 테이블을 만듭니다.
user@crpd1# set routing-options rib mpls.0
-
경로를 수용하는 정책을 구성합니다.
[edit policy-options policy-statement] user@crpd1# set EXPORT_LO term 10 from route-filter 10.2.2.2/32 exact user@crpd1# set EXPORT_LO term 10 then accept user@crpd1# set NH_SELF term 10 then next-hop self
-
PE1 및 기타 라우팅 인스턴스 매개 변수에서 VRF 라우팅 인스턴스를 구성합니다.
[edit routing-instances vrfblue] user@crpd1# set routing-options static route 10.1.1.1/32 next-hop 10.10.10.1 user@crpd1# set instance-type vrf user@crpd1# set route-distinguisher 100:100 user@crpd1# set vrf-target target:100:100
-
라우터 ID를 구성합니다.
user@crpd1# set routing-options router-id 10.2.2.2
-
BGP 세션을 구성합니다.
[edit protocols bgp group] user@crpd1# set underlay type external family inet unicast user@crpd1# set underlay type external export EXPORT_LO neighbor 10.20.20.3 family inet labeled-unicast resolve-vpn user@crpd1# set underlay type external export EXPORT_LO neighbor 10.20.20.3 peer-as 65002 local-as 65001 user@crpd1# set VPN type internal local-address 10.2.2.2 family inet-vpn unicast user@crpd1# set VPN local-as 65005 user@crpd1# set VPN neighbor 10.4.4.4 family inet-vpn unicast
-
MPLS에서 인터페이스를 구성합니다.
user@crpd1# set protocols mpls interface all
결과
구성 모드에서 및 show routing-instances
명령을 입력하여 show protocols bgp
구성을 확인합니다. 출력이 의도된 구성을 표시하지 않으면, 이 예의 구성 지침을 반복하여 수정합니다.
user@crpd1# show routing-instances vrfblue { routing-options { static { route 10.1.1.1/32 next-hop 10.10.10.1; } } instance-type vrf; route-distinguisher 100:100; vrf-target target:100:100; } user@crpd1# show protocols bgp group underlay { type external; family inet { unicast; } export EXPORT_LO; neighbor 10.20.20.3 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65002; local-as 65001; } neighbor 10.20.20.2 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65001; local-as 65002; } neighbor 10.30.30.4 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65003; local-as 65004; } } group VPN { type internal; local-address 10.2.2.2; family inet-vpn { unicast; } local-as 65005; neighbor 10.4.4.4 { family inet-vpn { unicast; } } }
디바이스 구성을 마쳤으면 구성 모드에서 commit을 입력합니다.
BGP LU를 사용하여 P 라우터 구성
단계별 절차
다음 예제에서는 구성 계층에서 다양한 수준의 탐색이 필요합니다.
-
mpls.0 테이블을 만듭니다.
user@crpd2# set routing-options rib mpls.0
-
경로를 수용하는 정책을 구성합니다.
[edit policy-options policy-statement] user@crpd2# set EXPORT_LO term 10 from route-filter 10.3.3.3/32 exact user@crpd2# set EXPORT_LO term 10 then accept user@crpd2# set NH_SELF term 10 then next-hop self
-
BGP 세션을 구성합니다.
[edit protocols bgp group] user@crpd2# set underlay type external export EXPORT_LO neighbor 10.20.20.2 family inet labeled-unicast resolve-vpn user@crpd2# set underlay type external export EXPORT_LO neighbor 10.20.20.2 peer-as 65001 user@crpd2# set underlay type external export EXPORT_LO neighbor 10.20.20.2 local-as 65002 user@crpd2# set underlay type external export EXPORT_LO neighbor 10.30.30.4 family inet labeled-unicast resolve-vpn user@crpd2# set underlay type external export EXPORT_LO neighbor 10.30.30.4 peer-as 65003 user@crpd2# set underlay type external export EXPORT_LO neighbor 10.30.30.4 local-as 65004
-
라우터 ID를 구성합니다.
user@crpd2# set routing-options router-id 10.3.3.3
-
MPLS에서 인터페이스를 구성합니다.
user@crpd2# set protocols mpls interface all
결과
구성 모드에서 및 show policy-options
명령을 입력하여 show protocols bgp
구성을 확인합니다. 출력 결과가 의도한 구성대로 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정하십시오.
user@crpd2# show protocols bgp group underlay { type external; export EXPORT_LO; neighbor 10.20.20.2 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65001; local-as 65002; } neighbor 10.30.30.4 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65003; local-as 65004; } }
user@crpd2# show policy-options policy-statement EXPORT_LO { term 10 { from { route-filter 10.3.3.3/32 exact; } then accept; } } policy-statement NH_SELF { term 10 { then { next-hop self; } } }
BGP LU를 사용하여 PE2 라우터 구성
단계별 절차
다음 예제에서는 구성 계층에서 다양한 수준의 탐색이 필요합니다.
-
mpls.0 테이블을 만듭니다.
user@crpd3# set routing-options rib mpls.0
-
경로를 수용하는 정책을 구성합니다.
[edit policy-options policy-statement] user@crpd3# set EXPORT_LO term 10 from route-filter 10.4.4.4/32 exact user@crpd3# set EXPORT_LO term 10 then accept user@crpd3# set NH_SELF term 10 then next-hop self
-
PE2 및 기타 라우팅 인스턴스 매개 변수에서 VRF 라우팅 인스턴스를 구성합니다.
[edit routing-instances vrfblue] user@crpd3# set routing-options static route 10.5.5.5/32 next-hop 10.40.40.5 user@crpd3# set instance-type vrf user@crpd3# set route-distinguisher 100:100 user@crpd3# set vrf-target target:100:100 user@crpd3# set interface all
-
BGP 세션을 구성합니다.
[edit protocols bgp group] user@crpd3# set underlay type external export EXPORT_LO neighbor 10.30.30.3 family inet labeled-unicast resolve-vpn user@crpd3# set underlay type external export EXPORT_LO neighbor 10.30.30.3 peer-as 65004 user@crpd3# set underlay type external export EXPORT_LO neighbor 10.30.30.3 local-as 65003 user@crpd3# set VPN type internal local-address 10.4.4.4 family inet-vpn unicast user@crpd3# set VPN local-as 65005 user@crpd3# set VPN neighbor 10.2.2.2 family inet-vpn unicast
-
라우터 ID를 구성합니다.
user@crpd3# set routing-options router-id 10.4.4.4
-
MPLS에서 인터페이스를 구성합니다.
user@crpd3# set protocols mpls interface all
결과
구성 모드에서 및 show routing-instances
명령을 입력하여 show protocols bgp
구성을 확인합니다. 출력 결과가 의도한 구성대로 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정하십시오.
user@crpd3# show protocols bgp group underlay { export EXPORT_LO; neighbor 10.30.30.3 { family inet { labeled-unicast { resolve-vpn; } } peer-as 65004; local-as 65003; } } group VPN { type internal; local-address 10.4.4.4; family inet-vpn { unicast; } local-as 65005; neighbor 10.2.2.2 { family inet-vpn { unicast; } } }
user@crpd3# show routing-instances vrfblue { routing-options { static { route 10.5.5.5/32 next-hop 10.40.40.5; } } interface all; instance-type vrf; route-distinguisher 100:100; vrf-target target:100:100; }
확인
PE1에서 VPNv4 확인
목적
PE1에서 VPNv4 경로를 확인하려면:
행동
운영 모드에서 명령을 입력합니다.show route table vrfblue.inet.0 10.5.5.5
user@crpd1> show route table vrfblue.inet.0 10.5.5.5
vrfblue.inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.5.5.5/32 *[BGP/170] 00:00:14, localpref 100, from 10.4.4.4 AS path: I, validation-state: unverified > to 10.20.20.3 via pe1-p, Push 299808, Push 299792(top)
운영 모드에서 명령을 입력합니다.show route table mpls.0
user@crpd1> show route table mpls.0
mpls.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 299808 *[VPN/170] 00:01:45 > to 10.10.10.1 via pe1-ce1, Pop 299808(S=0) *[VPN/170] 00:01:45 > to 10.10.10.1 via pe1-ce1, Pop 299824 *[VPN/170] 00:01:45 receive table vrfblue.inet.0, Pop
bash 모드에서 다음 명령을 입력합니다 ip route list table 5 5.5.5.5
.
user@crpd1> ip route list table 5 10.5.5.5
10.5.5.5 encap mpls 299792/299808 via 10.20.20.3 dev pe1-p proto 22
bash 모드에서 다음 명령을 입력합니다 ip -f mpls route
.
user@crpd1> ip -f mpls route
299808 via inet 10.10.10.1 dev pe1-ce1 proto 22
의미
PE1은 다음 vrfblue.inet.0
홉 10.4.4.4를 사용하여 PE2에서 학습한 CE2에 대한 경로를 가지고 있으며, 이는 P 라우터에서 BGP LU를 사용하여 확인되는 것을 볼 수 있습니다.
P에서 BGP LU 확인
목적
P에서 VPNv4 경로를 확인하려면 다음을 수행합니다.
행동
bash 모드에서 다음 명령을 입력합니다 ip -f mpls route show
.
user@crpd2> ip -f mpls route show
299776 via inet 10.20.20.2 dev p-pe1 proto 22 299792 via inet 10.30.30.4 dev p-pe2 proto 22
운영 모드에서 명령을 입력합니다.show route table mpls.0
user@crpd2> show route table mpls.0
mpls.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0 *[MPLS/0] 01:40:42, metric 1 Receive 1 *[MPLS/0] 01:40:42, metric 1 Receive 2 *[MPLS/0] 01:40:42, metric 1 Receive 13 *[MPLS/0] 01:40:42, metric 1 Receive 299776 *[VPN/170] 01:19:24 > to 10.20.20.2 via p-pe1, Pop 299776(S=0) *[ VPN/170] 01:19:24 > to 10.20.20.2 via p-pe1, Pop 299792 *[VPN/170] 01:19:20 > to 10.30.30.4 via p-pe2, Pop 299792(S=0) *[VPN/170] 01:19:20 > to 10.30.30.4 via p-pe2, Pop
의미
P에서 PE1 및 P에서 PE2로의 MPLS 및 VPN 경로를 볼 수 있습니다.
PE2에서 VPNv4 확인
목적
PE2에서 VPNv4 경로를 확인하려면:
행동
운영 모드에서 명령을 입력합니다.show route table vrfblue.inet.0 10.1.1.1
user@crpd3> show route table vrfblue.inet.0 10.1.1.1
vrfblue.inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.1.1.1/32 *[BGP/170] 00:00:26, localpref 100, from 10.2.2.2 AS path: I, validation-state: unverified > to 10.30.30.3 via pe2-p, Push 299808, Push 299776(top)
운영 모드에서 명령을 입력합니다.show route table mpls.0
user@crpd3> show route table mpls.0
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0 *[MPLS/0] 01:34:39, metric 1 Receive 1 *[MPLS/0] 01:34:39, metric 1 Receive 2 *[MPLS/0] 01:34:39, metric 1 Receive 13 *[MPLS/0] 01:34:39, metric 1 Receive 299808 *[VPN/170] 00:00:43 > to 10.40.40.5 via pe2-ce2, Pop 299808(S=0) *[VPN/170] 00:00:43 > to 10.40.40.5 via pe2-ce2, Pop 299824 *[VPN/170] 00:00:43 receive table vrfblue.inet.0, Pop
bash 모드에서 다음 명령을 입력합니다 ip route list table 5 10.1.1.1
.
user@crpd3> ip route list table 5 10.1.1.1
10.1.1.1 encap mpls 299776/299808 via 10.30.30.3 dev pe2-p proto 22
bash 모드에서 다음 명령을 입력합니다 ip -f mpls route
.
user@crpd3> ip -f mpls route
299808 via inet 10.40.40.5 dev pe2-ce2 proto 22
의미
PE2 라우터에서 PE1은 다음 홉을 10.2.2.2로 하는 VPNv4 접두사로 약 10.1.1.1의 BGP LU를 사용하여 VRF 테이블의 vrfblue.inet.0
경로를 표시합니다.