PTX 라우터의 선택적 클래스 기반 필터링
PTX 라우터의 선택적 클래스 기반 필터링
지원되는 PTX 시리즈 라우터 및 라인 카드의 경우 소스 또는 대상 분류(소스 클래스 사용, SCU) 및 (대상 클래스 사용, DCU)를 기반으로 IPv4 및 IPv6 트래픽을 필터링할 수 있습니다. 이는 클래스의 모든 패킷이 아닌 클래스의 패킷 하위 집합에 선택적으로 필터를 적용할 수 있다는 것을 의미하기 때문에 유용합니다. 또한 패킷 전달 엔진(PFE)을 통한 패킷 흐름이 최적화되고 필터링이 더 효율적입니다.
서비스 프로바이더의 경우 클래스 기반 필터링을 통해 다음과 같은 고급 서비스를 제공할 수 있습니다.
-
소스 또는 대상 패킷 클래스와 기타 필터 기준에 따라 패킷의 포워딩 클래스를 조정하여 홉별 동작 조작.
-
특정 고객 인터페이스에 대한 트래픽 속도가 제한되며, 대량의 트래픽이 손실됩니다(예: DDoS 공격 시). 일반적으로 트래픽 속도를 제한하기 위해 발신 인터페이스 필터를 구축합니다. 그러나 트래픽이 여전히 분산 시스템에서 패브릭을 통과하고 제한된 패브릭 대역폭을 소비하기 때문에 이는 비효율적일 수 있습니다. 이러한 비효율성은 PTX와 같은 가상 출력 대기열 시스템에서 더욱 두드러지게 나타나는데, PTX에서는 출력 필터가 실행되기 전에 송신 대기열로의 허용이 이루어지고 출력 필터의 후속 삭제 작업에는 보상이 필요합니다. 대기열에 더 많은 트래픽이 허용되어야 하므로 더 많은 패브릭 대역폭과 더 많은 송신 온칩 버퍼 공간(제한된 리소스)이 필요합니다. 클래스 기반 필터는 패킷이 송신 대기열로 유입되기 전에 수신 파이프라인에서 실행됩니다. 이 메커니즘은 특정 대상으로 대량의 트래픽을 드롭할 것으로 예상되는 경우 일반 출력 인터페이스 필터보다 권장됩니다.
클래스 기반 필터링은 정상적인 트래픽 패턴을 모방하여 애플리케이션 및 서버 리소스를 대상으로 하는 "낮고 느린" DoS 공격에도 효과적입니다.
클래스 기반 필터링을 지원하기 위해 PTX 라우터의 포워딩 테이블에 두 개의 새로운 바인드 포인트가 도입되었습니다. source-class
및 destination-class
.
CLI 계층은 여기에 표시되며, src-class-name 또는 dest-class-name 은 해당 정책에서 정의한 필터의 이름입니다.
routing-options forwarding-table source-class src-class-name family [inet | inet6] filter <filter-name>
routing-options forwarding-table destination-class dest-class-name family [inet | inet6] filter <filter-name>
또한 여러 SCU 및 DCU 클래스에 걸쳐 인스턴스별 필터를 구성할 수 있습니다. 기본적으로 하나의 카운터 및 폴리서 집합만 필터에 대해 인스턴스화됩니다. 인스턴스별 필터에서는 각 필터 첨부 지점에 대해 별도의 카운터 및 폴리서 집합이 생성됩니다.
firewall family [inet | inet6] filter <filter name> instance-specific
PTX 라우터의 클래스 기반 필터링 이해
처음에는 SCU(Source Class Usage) 기능이 도입되어 원래 접두사(소스 클래스로 식별)별로 특정 인터페이스로 전송된 트래픽의 통계 분석을 제공합니다. DCU(Destination Class Usage)는 원래 대상 클래스로 식별되는 대상 접두사별로 인터페이스에서 수신된 트래픽의 통계 분석을 제공하기 위해 도입되었습니다.
소스 또는 대상 클래스 모두 소스 또는 대상 조회 프로세스의 패킷에 할당됩니다. 따라서 원본 및 대상 필터 일치 조건은 조회 후 필터가 실행되는 경우에만 평가할 수 있습니다.
주니퍼 라우터는 여러 필터 바인드 지점을 지원하며, 소스 및 대상 분류 결과를 활용할 수 있는 바인드 포인트는 사용 지침과 함께 아래에 나열되어 있습니다.
-
출력 인터페이스 필터(인터페이스 설정<인터페이스 이름> 제품군 inet 필터 <output>. 모든 PTX 플랫폼에서 지원되지만, 안정적인 상태에서 대량의 트래픽을 폐기할 것으로 예상되는 경우(예: 디도스(DDoS) 공격 완화 필터 구현 시) 권장되지 않습니다. 폐기된 디도스(DDoS) 공격 트래픽은 제한된 패브릭 대역폭과 제한된 송신 온칩 버퍼 공간으로 인해 디도스(DDoS) 공격 기준과 일치하지 않는 다른 트래픽에 의해 보상되지 않을 수 있습니다.
-
포워딩 테이블 필터 조회 후 필터링(forwarding-options family inet filter<filter-name> 출력 설정). Express 2(PE) 및 Express 3(ZX) 플랫폼에서 지원됩니다. 그러나 필터는 송신 파이프라인에서 인스턴스화되므로 폐기 동작은 일반 출력 인터페이스 필터와 유사합니다.
-
소스 또는 대상 클래스별 바인딩 지점(set routing-options forwarding-table source-class src-class-name family [inet | inet6] filter<filter- name>). Express 2(PE), Express 3(ZX) 및 Express 4(BT) 플랫폼에서 지원됩니다. 이 필터는 수신 파이프라인에서 인스턴스화됩니다. 이는 대량의 트래픽을 삭제할 때 권장되는 옵션입니다. 이 옵션은 포워딩 클래스를 재정의하고 이후에 대기열 할당을 출력해야 하는 경우에도 권장됩니다. 가상 출력 대기열 시스템에서는 수신 파이프라인에서 대기열이 선택되며 모든 재정의는 수신 파이프라인에서도 발생해야 합니다.
-
이러한 필터 동작은 소스 또는 대상 클래스별 바인딩 지점에 바인딩된 필터에서 지원되지 않습니다.
-
라우팅 인스턴스
-
넥스트-IP
-
다음 인터페이스
-
캡슐화 해제
-
캡슐화
-
-
선택적 클래스 기반 필터는 호스트 바운드 패킷에 적용할 수 없습니다.
-
uRPF 조회에 실패하였으나 uRPF 실패 필터에 의해 복원된 패킷은 SCU/DCU 조회의 대상이 아닙니다. 따라서, 선택적 클래스 기반 필터는 이러한 패킷에 적용될 수 없습니다.
-
필터는 SCU/DCU 기능이 활성화된 인터페이스에서 수신되는 패킷에만 적용됩니다. 즉, SCU가 출력 인터페이스에 구성되었는지 여부와 관계없이 필터가 적용됩니다.
-
선택적 클래스 기반 필터를 적용해야 하는 패킷은 성능 저하를 유발할 수 있습니다. 성능 저하는 유입 트래픽 속도, 평균 패킷 크기, 필터에 적용되는 트래픽 양의 함수입니다. 그러나 선택적 클래스 기반 필터가 적용되지 않은 패킷은 성능에 영향을 미치지 않습니다.
-
DCU 어카운팅은 필터에 의해 손실된 패킷에 적용됩니다.
-
SCU 출력 어카운팅은 필터에 의해 손실된 패킷에는 적용되지 않습니다.
-
선택적 클래스 기반 필터는 인터페이스별 노브와 함께 사용할 수 없습니다. 이 노브는 인터페이스 연결 필터에만 적용되기 때문입니다.
-
선택적 클래스 기반 필터의 목록(입력/출력 목록)은 지원되지 않습니다.
-
논리 시스템은 지원되지 않습니다.
-
IPv4 및 IPv6만 지원되는 페이로드 프로토콜입니다. MPLS는 지원되지 않습니다.
-
패킷이 SCU와 DCU 선택적 클래스 기반 필터 모두와 일치하면 마지막 필터(즉, DCU 필터)만 패킷에 적용되고 두 필터 모두에 적용되지는 않습니다.
예: 선택적 클래스 기반 필터링(PTX 라우터)
이 예는 소스 또는 대상 분류를 기반으로 IPv4 및 IPv6 트래픽 플로우에 방화벽 작업(폐기, 거부 또는 폴리싱)을 적용하는 방법을 보여줍니다. 이는 Junos Evolved OS 릴리스 21.2를 실행하는 PTX10001-36MR, PTX10003-160C, PTX10003-80C, PTX10004 및 PTX10008 라우터PTX10016, JUNOS Evolved OS 릴리스 21.4를 실행하는 라우터 또는 PTX3000, PTX-5000, PTX1000, PTX10002, PTX10008 PTX10016 Junos OS 릴리스 21.2 이상의 소프트웨어를 실행하는 라우터에 적용됩니다.
요구 사항
고객 에지, 프로바이더 에지 및 프로바이더 라우터로 구성된 네트워크 토폴로지에서 디바이스 간에 경로를 교환하는 데 BGP를 사용할 수 있으므로 이 예에서는 BGP를 사용합니다. 자세한 내용은 BGP 구성 개요를 참조하십시오.
개요
이 예에서는 세 가지 라우팅 디바이스를 사용합니다. 고객 에지(CE) 디바이스, 프로바이더 에지(PE) 디바이스 및 프로바이더 코어(P) 디바이스. IPv4 트래픽에 대한 구성이 표시되며, 여기에는 두 세트의 SCU 및 DCU 클래스와 방화벽 필터가 포함됩니다. 다음 그림에서 /32 IP 접두사는 각각 고객 에지(CE) 및 프로바이더(P) 라우터에 연결된 호스트를 나타냅니다.

이 예에서는 두 가지 트래픽 클래스를 정의합니다. SCU-1 및 SCU-2인 경우, 첫 번째는 서브넷 172.16.2.0/24의 접두사에 할당되고 두 번째는 서브넷 172.16.3.0/24의 접두사에 할당됩니다. 다른 접두사에는 클래스 할당이 없습니다. 다음 CLI 스니펫에서 볼 수 있듯이 라우팅 정책은 PE 라우터에 정의되어 source-class scu-1 및 source-class scu-2에 접두사를 할당합니다.
show policy-options policy-statement scu-class { term gold { from { route-filter 172.16.2.0/24 orlonger; } then source-class scu-1; accept; term silver { from { route-filter 172.16.3.0/24 orlonger; } then source-class scu-2; accept; }
CE에서 PE의 인터페이스로 들어오는 트래픽을 처리하기 위해 PE 라우터에 정의된 dcu-class 라는 정책은 경로 필터를 사용하여 트래픽을 dcu-1에 배치하며, 다른 접두사에는 클래스 할당이 없습니다.
show policy-options policy-statement dcu-class { term gold { from { route-filter 172.16.5.0/24 orlonger; } then destination-class dcu-1; accept; }
그런 다음 정책이 포워딩 테이블에 적용됩니다.
forwarding-table { export [ dcu_class scu_class ]; }
다음 단계에서는 PE 라우터에 필터를 구성합니다.
show firewall { family inet { filter f1 { term t1 { from { protocol icmp; } then { count c1; } } } } }
그리고 이 필터를 PE 라우터의 특정 소스 및 대상 클래스 바인드 포인트에 연결합니다.
show routing-options forwarding-table source-class scu-1 { family inet { filter { f1; } } } destination-class dcu-1 { family inet { filter { f1; } } }
구성
절차
CLI 빠른 구성
이 예를 빠르게 구성하려면 다음 명령을 복사하여 텍스트 파일에 붙여 넣은 다음 줄 바꿈을 제거하고, 네트워크 구성과 일치하는 데 필요한 세부 정보를 변경한 다음, 명령을 복사하여 CLI에 붙여넣습니다.
이 예제에서는 정적 경로를 사용하여 작업 테스트를 위한 연결 및 루프백 인터페이스 주소를 제공합니다.
장치 CE
set interfaces et-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 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 et-1/2/0 unit 0 family inet address 10.0.0.2/30 set interfaces et-1/2/1 unit 0 family inet accounting source-class-usage input set interfaces et-1/2/1 unit 0 family inet accounting destination-class-usage set interfaces et-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 gold from route-filter 172.16.5.0/24 orlonger set policy-options policy-statement dcu_class term gold then destination-class dcu-1 set policy-options policy-statement scu_class term gold from route-filter 172.16.2.0/24 orlonger set policy-options policy-statement scu_class term gold then source-class scu-1 set policy-options policy-statement scu_class term silver from route-filter 172.16.3.0/24 orlonger set policy-options policy-statement scu_class term silver then source-class scu-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 firewall family inet filter f1 term 0 from protocol icmp set firewall family inet filter f1 term 0 then count c1 set firewall family inet filter f1 term 0 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 et-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
단계별 절차
포워딩 클래스에서 소스 및 목적지 접두사를 그룹화하려면:
-
PE 라우터에 라우터 인터페이스를 생성합니다.
[edit interfaces] set et-1/2/0 unit 0 family inet accounting source-class-usage output set et-1/2/0 unit 0 family inet address 10.0.0.2/30 set et-1/2/1 unit 0 family inet accounting source-class-usage input set et-1/2/1 unit 0 family inet accounting destination-class-usage set et-1/2/1 unit 0 family inet address 10.1.0.1/30 set lo0 unit 0 family inet address 192.168.0.2/32
-
PE 라우터에서 BGP를 구성합니다.
[edit] 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
-
PE 라우터의 AS(Autonomous System) 번호를 구성합니다.
[edit] set routing-options autonomous-system 200
-
PE 라우터에서 DCU 정책을 구성합니다.
[edit] set policy-options policy-statement dcu_class term class-1 from route-filter 172.16.5.0/24 orlonger set policy-options policy-statement dcu_class term class-1 then destination-class dcu-1
-
PE 라우터에서 SCU 정책을 구성합니다.
[edit] set policy-options policy-statement scu_class term class-1 from route-filter 172.16.2.0/24 orlonger set policy-options policy-statement scu_class term class-1 then source-class scu-1
-
PE 라우터의 포워딩 테이블에 정책을 적용합니다.
[edit] set routing-options forwarding-table export dcu_class set routing-options forwarding-table export scu_class
-
PE 라우터에 필터를 생성합니다.
[edit] set firewall family inet filter f1 from protocol icmp then count c1
-
필터를 PE 라우터의 소스 클래스 및 대상 클래스 바인드 포인트에 바인딩합니다.
필터를 대상 클래스 사용에 바인딩합니다.
[edit] set routing-options forwarding-table destination-class dcu-1 family inet filter f1
필터를 소스 클래스 사용에 바인딩합니다.
[edit] set routing-options forwarding-table source-class scu-1 family inet filter f1
-
(선택 사항) PE 라우터에서 직접 경로를 광고하는 라우팅 정책을 구성합니다.
[edit] set policy-options policy-statement send-direct term 1 from protocol direct set policy-options policy-statement send-direct term 1 then accept
결과
구성 모드 에서 PE 라우터에 , show interfaces
show protocols
, show policy-options
, 및 show routing-options
명령을 실행하여 구성을 확인합니다. 출력 결과가 의도한 구성대로 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정하십시오.
show interfaces et-1/2/0 { unit 0 { family inet { address 10.0.0.2/30; } } } et-1/2/1 { unit 0 { family inet { accounting { source-class-usage { input; } } address 10.1.0.1/30; } } } lo0 { unit 0 { family inet { address 192.168.0.2/32; } } }
show interface statistics et-1/2/0 Physical interface: et-1/2/0:0, Enabled, Physical link is Up Interface index: 1087, SNMP ifIndex: 622 Link-level type: Ethernet, MTU: 1514, LAN-PHY mode, Speed: 10Gbps, BPDU Error: None, Loop Detect PDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, Media type: Fiber Device flags : Present Running Interface flags: SNMP-Traps CoS queues : 8 supported, 8 maximum usable queues Current address: e4:5d:37:4e:e8:40, Hardware address: e4:5d:37:4e:e8:40 Last flapped : 2021-03-16 09:33:43 PDT (03:39:51 ago) Statistics last cleared: 2021-03-16 13:13:01 PDT (00:00:33 ago) Input rate : 0 bps (0 pps) Output rate : 0 bps (0 pps) Input errors: 0, Output errors: 0 Active alarms : None Active defects : None PCS statistics Seconds Bit errors 0 Errored blocks 0 PRBS Mode : Disabled Interface transmit statistics: Disabled Link Degrade : Link Monitoring : Disable Logical interface et-1/2/0:0.0 (Index 1047) (SNMP ifIndex 673) Flags: Up SNMP-Traps Encapsulation: ENET2 Input packets : 14 Output packets: 6 Protocol inet, MTU: 1500 Flags: Sendbcast-pkt-to-re, SCU-out Packets Bytes Source class (packet-per-second) (bits-per-second) scu-1 6 504 ( 0)( 0) Addresses, Flags: Is-Preferred Is-Primary Destination: 44.4.4/24, Local: 44.4.4.4, Broadcast: 44.4.4.255 Protocol inet6, MTU: 1500 Flags: None, SCU-out Packets Bytes Source class (packet-per-second) (bits-per-second) scu-1 0 0 ( 0) ( 0) Addresses, Flags: Is-Preferred Is-Primary Destination: 4001::/64, Local: 4001::4001 Addresses, Flags: Is-Preferred Destination: fe80::/64, Local: fe80::e65d:37ff:fe4e:e840 Protocol multiservice, MTU: Unlimited Flags: None
show firewall Filter: f1 Counters: Name Bytes Packets c1 0 0 Filter: v4_instance_new-scu-scu-1 Counters: Name Bytes Packets c_v4_instance_new-scu-scu-1 504 6 Filter: v6_instance_new-scu-scu-1 Counters: Name Bytes Packets c_v6_instance_new-scu-scu-1 0 0
show policy-options policy-statement dcu_class { term class-1 { from { route-filter 172.16.5.0/24 orlonger; } then destination-class dcu-1; } } policy-statement scu_class { term class-1 { from { route-filter 172.16.2.0/24 orlonger; } then source-class scu-1; } } policy-statement send-direct { term 1 { from protocol direct; then accept; } }
show routing-options autonomous-system 200; forwarding-table { export [ dcu_class scu_class ]; }
디바이스 구성을 완료하면 구성 모드에서 commit을 입력합니다.