예를 들면 다음과 같습니다. 포링 클래스로 소스 및 목적지 Prefix 그룹화
이 예에서는 소스 및 대상 Prefix를 포링 클래스로 그룹화하는 방법을 보여줍니다.
요구 사항
이 예제를 구성하기 전에 장치 초기화 이외에는 특별한 구성이 필요하지 않습니다.
개요
이 예에서는 세 가지 라우팅 디바이스를 사용했습니다. 고객 에지(고객 에지(CE)) 디바이스, PE(Provider Edge) 디바이스, 서비스 제공업체 코어(P) 디바이스 등 3개 디바이스가 있습니다.
그림 1 샘플 네트워크를 보여줍니다.

소스 클래스 사용(SCU)은 IP 소스 주소 및 IP 대상 주소에 대한 룩업을 수행하여 고객 에지로 전송된 패킷을 계산합니다. SCU를 사용하면 제공업체 코어의 특정 프리픽스에서 시작하여 고객 에지의 특정 Prefix를 위한 트래픽을 추적할 수 있습니다.
DCU는 IP 대상 주소에 대한 조사를 수행하여 고객의 패킷을 계산합니다. DCU를 사용하면 고객 에지에서 오는 트래픽을 추적하고 제공업체 코어 라우터의 특정 Prefix를 위한 트래픽을 추적할 수 있습니다.
Provider Core(Device P로 표현)를 마주하고 있는 Device PE의 fe-1/2/1 인터페이스에서 SCU 입력은 Device P에서 시작된 트래픽을 추적하고 source-class-usage input
Device 고객 에지(CE). 이 동일한 인터페이스에서, 명령문은 서비스 제공업체 코어로 연결되는 Device 고객 에지(CE) 트래픽을 destination-class-usage input
추적하도록 구성됩니다.
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 모니터링 트래픽이 도착하고 출발할 것으로 예상되는 2개의 인터페이스를 명시적으로 정의해야 합니다. 이는 SCU가 라우팅 테이블에서 소스 주소(SA) 및 대상 주소(DA) 룩업. 이와 반대로 DCU는 단일 대상 주소 룩업만 합니다.
Device PE의 fe-1/2/0 인터페이스에서 Device 고객 에지(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 라우트 필터를 사용하여 골드1, 골드2 및 골드3 클래스로 트래픽을 배정합니다.
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 라우트 필터를 사용하여 실버1, 실버2 및 실버3 클래스에 트래픽을 배정합니다.
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 섹션에서는 Device 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
단계별 절차
다음 예제에서는 구성 계층의 다양한 수준을 탐색해야 합니다. 그 방법에 대한 지침은 구성 모드에서 CLI 편집자Junos OS CLI.
포우링 클래스에서 소스 및 대상 Prefix를 그룹화하기:
라우터 인터페이스를 생성합니다.
[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(Border Gateway Protocol).
[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
주:동일한 또는 다른 수출 명령문에서 1회 이상 동일한 라우팅 정책을 참조할 수 있습니다.
(선택 사항) 직접 경로를 광고하는 라우팅 정책을 구성합니다.
[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 interfaces
show protocols
show policy-options
show routing-options
구성을 확인 출력이 의도한 구성을 표시하지 않는 경우 이 예제의 지침을 반복하여 구성을 수정합니다.
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 정책 카운터의 증가를 야기하는지 확인합니다.
실행
Device P에서 고객 네트워크의 주소를 핑(ping)
user@P> ping rapid count 10000000 172.16.0.1 PING 172.16.0.1 (6.0.0.1): 56 data bytes !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Device 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 정책 카운터의 증가를 야기하는지 확인합니다.
실행
Device 고객 에지(CE) 고객 네트워크의 주소를 ping합니다.
user@CE> ping rapid count 10000000 172.16.0.1 PING 172.16.0.1 (6.0.0.1): 56 data bytes !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Device 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
의미
패킷 및 비트 속도는 패킷 및 바이트 카운터와 함께 표시됩니다.
또는 이 명령을 사용하여 동일한 show interfaces source-class all
정보를 표시할 수 있습니다.