예를 들면 다음과 같습니다. 소스 및 대상 접두사들을 포워딩 클래스로 그룹화
이 예는 소스 및 대상 접두사들을 포워딩 클래스로 그룹화하는 방법을 보여줍니다.
요구 사항
이 예를 구성하기 전에 디바이스 초기화를 제외한 특별한 구성은 필요하지 않습니다.
개요
이 예에서는 다음과 같은 세 가지 라우팅 디바이스를 사용합니다. 고객 에지(CE) 디바이스, 프로바이더 에지(PE) 디바이스 및 프로바이더 코어(P) 디바이스입니다.
그림 1 은 샘플 네트워크를 보여줍니다.

SCU(소스 클래스 사용)는 IP 소스 주소 및 IP 대상 주소에 대한 조회를 수행하여 고객 에지로 전송된 패킷을 계산합니다. SCU를 사용하면 프로바이더는 코어의 특정 접두사에서 시작되어 고객 에지의 특정 접두사로 향하는 트래픽을 추적할 수 있습니다.
DCU는 IP 대상 주소를 조회하여 고객의 패킷을 계산합니다. DCU를 사용하면 고객 에지에서 시작되어 공급자 코어 라우터 특정 접두사로 향하는 트래픽을 추적할 수 있습니다.
디바이스 PE의 fe-1/2/1 인터페이스에서 공급자 코어(디바이스 P로 표시)를 마주보고 있는 SCU 입력은 디바이스 P에서 시작되어 디바이스 CE로 향하는 트래픽을 추적하도록 문으로 source-class-usage input
구성됩니다. 이 동일한 인터페이스에서 destination-class-usage input
문은 공급자 코어로 향하는 디바이스 CE에서 발생하는 트래픽을 추적하도록 구성됩니다.
user@PE# show interfaces fe-1/2/1 unit 0 family inet
accounting {
source-class-usage {
input; # tracks traffic destined to customer edge
}
destination-class-usage; # tracks traffic destined to provider core
}
address 10.1.0.1/30;
단일 인터페이스에서만 구현이 필요한 DCU(대상 클래스 사용)와 달리 SCU에 대한 어카운팅은 두 개의 인터페이스에서 활성화되어야 합니다. 소스 클래스가 트래버스하는 인바운드 및 아웃바운드 인터페이스입니다. SCU 모니터링 트래픽이 도착 및 출발할 것으로 예상되는 두 인터페이스를 명시적으로 정의해야 합니다. 이는 SCU가 라우팅 테이블 두 가지 조회를 수행하기 때문입니다. 소스 주소(SA) 및 대상 주소(DA) 조회입니다. 반면 DCU에는 단일 대상 주소 조회만 있습니다.
디바이스 PE의 fe-1/2/0 인터페이스에서 디바이스 CE를 마주보고 있는 SCU 출력은 문으로 source-class-usage output
구성됩니다.
user@PE# show interfaces fe-1/2/0 unit 0 family inet
accounting {
source-class-usage {
output;
}
}
address 10.0.0.2/30;
고객에게 전달되는 트래픽을 고려하기 위해 scu_class라는 정책은 경로 필터를 사용하여 트래픽을 gold1, gold2 및 gold3 클래스에 배치합니다.
user@PE# show policy-options
policy-statement scu_class {
term gold1 {
from {
route-filter 172.16.2.0/24 orlonger;
}
then source-class gold1;
}
term gold2 {
from {
route-filter 172.16.3.0/24 orlonger;
}
then source-class gold2;
}
term gold3 {
from {
route-filter 172.16.4.0/24 orlonger;
}
then source-class gold3;
}
}
공급자로 향하는 트래픽을 설명하기 위해 dcu_class 라는 정책은 경로 필터를 사용하여 트래픽을 silver1, silver2 및 silver3 클래스에 배치합니다.
user@PE# show policy-options
policy-statement dcu_class {
term silver1 {
from {
route-filter 172.16.5.0/24 orlonger;
}
then destination-class silver1;
}
term silver2 {
from {
route-filter 172.16.6.0/24 orlonger;
}
then destination-class silver2;
}
term silver3 {
from {
route-filter 172.16.7.0/24 orlonger;
}
then destination-class silver3;
}
}
그런 다음 정책이 포워딩 테이블 적용됩니다.
forwarding-table { export [ dcu_class scu_class ]; }
이 예는 정적 경로를 사용하여 작동 테스트를 위한 연결 및 루프백 인터페이스 주소를 제공합니다.
CLI 빠른 구성 은(는) 의 모든 디바이스 그림 1에 대한 구성을 보여줍니다.
섹션 #configuration715__scu-dcu-sample-st 은 디바이스 PE의 단계를 설명합니다.
구성
절차
CLI 빠른 구성
이 예를 빠르게 구성하려면, 아래 명령을 복사하여 텍스트 파일로 붙여 넣은 다음 모든 라인브러브를 제거하고, 네트워크 구성을 일치하는 데 필요한 세부 사항을 변경한 다음 계층 수준에서 명령을 CLI [edit]
로 복사해 붙여 넣습니다.
디바이스 CE
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.1/30 set interfaces lo0 unit 0 family inet address 192.168.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set interfaces lo0 unit 0 family inet address 172.16.0.1/32 set protocols bgp group ext type external set protocols bgp group ext export send-direct set protocols bgp group ext export send-static set protocols bgp group ext peer-as 200 set protocols bgp group ext neighbor 10.0.0.2 set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 then accept set policy-options policy-statement send-static term 1 from protocol static set policy-options policy-statement send-static term 1 then accept set routing-options static route 10.1.0.0/30 next-hop 10.0.0.2 set routing-options autonomous-system 100
디바이스 PE
set interfaces fe-1/2/0 unit 0 family inet accounting source-class-usage output set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.2/30 set interfaces fe-1/2/1 unit 0 family inet accounting source-class-usage input set interfaces fe-1/2/1 unit 0 family inet accounting destination-class-usage set interfaces fe-1/2/1 unit 0 family inet address 10.1.0.1/30 set interfaces lo0 unit 0 family inet address 192.168.0.2/32 set protocols bgp group ext type external set protocols bgp group ext export send-direct set protocols bgp group ext neighbor 10.0.0.1 peer-as 100 set protocols bgp group ext neighbor 10.1.0.2 peer-as 300 set policy-options policy-statement dcu_class term silver1 from route-filter 172.16.5.0/24 orlonger set policy-options policy-statement dcu_class term silver1 then destination-class silver1 set policy-options policy-statement dcu_class term silver2 from route-filter 172.16.6.0/24 orlonger set policy-options policy-statement dcu_class term silver2 then destination-class silver2 set policy-options policy-statement dcu_class term silver3 from route-filter 172.16.7.0/24 orlonger set policy-options policy-statement dcu_class term silver3 then destination-class silver3 set policy-options policy-statement scu_class term gold1 from route-filter 172.16.2.0/24 orlonger set policy-options policy-statement scu_class term gold1 then source-class gold1 set policy-options policy-statement scu_class term gold2 from route-filter 172.16.3.0/24 orlonger set policy-options policy-statement scu_class term gold2 then source-class gold2 set policy-options policy-statement scu_class term gold3 from route-filter 172.16.4.0/24 orlonger set policy-options policy-statement scu_class term gold3 then source-class gold3 set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 then accept set routing-options autonomous-system 200 set routing-options forwarding-table export dcu_class set routing-options forwarding-table export scu_class
디바이스 P
set interfaces fe-1/2/1 unit 0 family inet address 10.1.0.2/30 set interfaces lo0 unit 0 family inet address 192.168.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set interfaces lo0 unit 0 family inet address 172.16.0.3/32 set protocols bgp group ext type external set protocols bgp group ext export send-direct set protocols bgp group ext export send-static set protocols bgp group ext peer-as 200 set protocols bgp group ext neighbor 10.1.0.1 set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 then accept set policy-options policy-statement send-static term 1 from protocol static set policy-options policy-statement send-static term 1 then accept set routing-options static route 10.0.0.0/30 next-hop 10.1.0.1 set routing-options static route 172.16.2.0/24 discard set routing-options static route 172.16.3.0/24 discard set routing-options static route 172.16.4.0/24 discard set routing-options static route 172.16.5.0/24 discard set routing-options static route 172.16.6.0/24 discard set routing-options static route 172.16.7.0/24 discard set routing-options autonomous-system 300
단계별 절차
다음 예제에서는 구성 계층에서 다양한 수준의 탐색이 필요합니다. 자세한 내용은 Junos OS CLI 사용자 가이드에서 을(를) 참조하십시오구성 모드에서 CLI 편집기 사용.
포워딩 클래스에서 소스 및 대상 접두사 그룹화:
라우터 인터페이스를 생성합니다.
[edit interfaces] user@PE# set fe-1/2/0 unit 0 family inet accounting source-class-usage output user@PE# set fe-1/2/0 unit 0 family inet address 10.0.0.2/30 user@PE# set fe-1/2/1 unit 0 family inet accounting source-class-usage input user@PE# set fe-1/2/1 unit 0 family inet accounting destination-class-usage user@PE# set fe-1/2/1 unit 0 family inet address 10.1.0.1/30 user@PE# set lo0 unit 0 family inet address 192.168.0.2/32
BGP를 구성합니다.
[edit protocols bgp group ext] user@PE# set type external user@PE# set export send-direct user@PE# set neighbor 10.0.0.1 peer-as 100 user@PE# set neighbor 10.1.0.2 peer-as 300
DCU 정책을 구성합니다.
[edit policy-options policy-statement dcu_class] user@PE# set term silver1 from route-filter 172.16.5.0/24 orlonger user@PE# set term silver1 then destination-class silver1 user@PE# set term silver2 from route-filter 172.16.6.0/24 orlonger user@PE# set term silver2 then destination-class silver2 user@PE# set term silver3 from route-filter 172.16.7.0/24 orlonger user@PE# set term silver3 then destination-class silver3
SCU 정책을 구성합니다.
[edit policy-options policy-statement scu_class] user@PE# set term gold1 from route-filter 172.16.2.0/24 orlonger user@PE# set term gold1 then source-class gold1 user@PE# set term gold2 from route-filter 172.16.3.0/24 orlonger user@PE# set term gold2 then source-class gold2 user@PE# set term gold3 from route-filter 172.16.4.0/24 orlonger user@PE# set term gold3 then source-class gold3
정책을 포워딩 테이블 적용합니다.
[edit routing-options forwarding-table] user@PE# set export dcu_class user@PE# set export scu_class
주:동일하거나 다른 내보내기 문에서 동일한 라우팅 정책 한 번 이상 참조할 수 있습니다.
(선택 사항) 직접 경로를 보급하는 라우팅 정책 구성합니다.
[edit policy-options policy-statement send-direct term 1] user@PE# set from protocol direct user@PE# set then accept
AS(Autonomous System) 번호를 구성합니다.
[edit routing-options] user@PE# set autonomous-system 200
결과
구성 모드에서 , , show protocols
show policy-options
및 show routing-options
명령을 실행하여 show interfaces
구성을 확인합니다. 출력에 의도한 구성이 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정합니다.
user@PE# show interfaces fe-1/2/0 { unit 0 { family inet { accounting { source-class-usage { output; } } address 10.0.0.2/30; } } } fe-1/2/1 { unit 0 { family inet { accounting { source-class-usage { input; } destination-class-usage; } address 10.1.0.1/30; } } } lo0 { unit 0 { family inet { address 192.168.0.2/32; } } }
user@PE# show protocols bgp { group ext { type external; export send-direct; neighbor 10.0.0.1 { peer-as 100; } neighbor 10.1.0.2 { peer-as 300; } } }
user@PE# show policy-options policy-statement dcu_class { term silver1 { from { route-filter 172.16.5.0/24 orlonger; } then destination-class silver1; } term silver2 { from { route-filter 172.16.6.0/24 orlonger; } then destination-class silver2; } term silver3 { from { route-filter 172.16.7.0/24 orlonger; } then destination-class silver3; } } policy-statement scu_class { term gold1 { from { route-filter 172.16.2.0/24 orlonger; } then source-class gold1; } term gold2 { from { route-filter 172.16.3.0/24 orlonger; } then source-class gold2; } term gold3 { from { route-filter 172.16.4.0/24 orlonger; } then source-class gold3; } } policy-statement send-direct { term 1 { from protocol direct; then accept; } }
user@PE# show routing-options autonomous-system 200; forwarding-table { export [ dcu_class scu_class ]; }
디바이스 구성이 완료되면 구성 모드에서 을(를) 입력합니다 commit
.
확인
구성이 제대로 작동하는지 확인합니다.
DCU 정책이 작동하는지 확인
목적
프로바이더 코어에서 고객 네트워크로 전송된 트래픽이 DCU 정책 카운터를 증가시키는지 확인합니다.
실행
디바이스 P에서 고객 네트워크의 주소를 ping합니다.
user@P> ping rapid count 10000000 172.16.0.1 PING 172.16.0.1 (6.0.0.1): 56 data bytes !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
디바이스 PE에서 공급자 코어를 향한 인터페이스의 인터페이스 통계를 확인합니다.
user@PE> show interfaces statistics fe-1/2/1.0 Logical interface fe-1/2/1.0 (Index 108) (SNMP ifIndex 546) Flags: SNMP-Traps 0x4000 Encapsulation: ENET2 Input packets : 251956 Output packets: 251961 Protocol inet, MTU: 1500 Flags: Sendbcast-pkt-to-re, DCU, SCU-in Packets Bytes Destination class (packet-per-second) (bits-per-second) silver1 7460 626640 ( 0) ( 0) silver2 22440 2401416 ( 256) ( 171963) silver3 9004 756336 ( 0) ( 0) Addresses, Flags: Is-Preferred Is-Primary Destination: 10.1.0.0/30, Local: 10.1.0.1, Broadcast: 10.1.0.3
의미
패킷 및 비트 속도는 패킷 및 바이트 카운터로 표시됩니다.
또는 명령을 사용하여 show interfaces destination-class all
동일한 정보를 표시할 수 있습니다.
SCU 정책이 작동하는지 확인
목적
고객 네트워크에서 프로바이더 코어로 전송되는 트래픽으로 인해 SCU 정책 카운터가 증가하게 되는지 확인합니다.
실행
디바이스 CE에서 고객 네트워크의 주소를 ping합니다.
user@CE> ping rapid count 10000000 172.16.0.1 PING 172.16.0.1 (6.0.0.1): 56 data bytes !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
디바이스 PE에서 고객 네트워크를 마주보고 있는 인터페이스의 인터페이스 통계를 확인합니다.
user@PE> show interfaces statistics fe-1/2/0.0 Logical interface fe-1/2/0.0 (Index 93) (SNMP ifIndex 554) Flags: SNMP-Traps 0x4000 Encapsulation: ENET2 Input packets : 32246 Output packets: 32245 Protocol inet, MTU: 1500 Flags: Sendbcast-pkt-to-re, Is-Primary, SCU-out Packets Bytes Source class (packet-per-second) (bits-per-second) gold1 8871 745164 ( 259) ( 174497) gold2 1812 152208 ( 0) ( 0) gold3 5711 479724 ( 0) ( 0) Addresses, Flags: Is-Preferred Is-Primary Destination: 10.0.0.0/30, Local: 10.0.0.2, Broadcast: 10.0.0.3