예: GRE 또는 IP-IP 터널에 대한 CoS 구성
이 주제는 GRE 또는 IP-IP 터널에 대해 CoS(Class of Service)를 구성하는 방법에 대한 예를 보여줍니다.
요구 사항
이 예를 구성하기 전에 디바이스 초기화를 제외한 특별한 구성은 필요하지 않습니다.
개요
토폴로지
그림 1에서 라우터 A는 터널 수신 디바이스 역할을 합니다. 라우터 A와 ge-1/3/0
라우터 B의 인터페이스 ge-1/0/0
사이의 링크는 GRE 또는 IP-IP 터널입니다. 라우터 A는 인터페이스ge-1/3/0
에서 수신된 트래픽을 모니터링합니다. 인터페이스ge-1/0/0
를 통해 라우터 C는 라우터 B에 대한 트래픽을 생성합니다.
구성
이 예를 구성하려면 다음 작업을 수행하십시오.
CLI 빠른 구성
이 예를 빠르게 구성하려면, 아래 명령을 복사하여 텍스트 파일로 붙여 넣은 다음 모든 라인브러브를 제거하고, 네트워크 구성을 일치하는 데 필요한 세부 사항을 변경한 다음 계층 수준에서 명령을 CLI [edit]
로 복사해 붙여 넣습니다.
라우터 A
set interfaces ge-1/0/0 unit 0 family inet address 10.80.0.2/24 set interfaces ge-1/0/1 unit 0 family inet filter input zf-catch-all set interfaces ge-1/0/1 unit 0 family inet address 10.90.0.2/24 set interfaces gr-2/1/0 unit 0 tunnel source 10.11.11.11 destination 10.255.245.46 set interfaces gr-2/1/0 unit 0 family inet address 10.21.21.21/24 set interfaces ip-2/1/0 unit 0 tunnel source 10.12.12.12 destination 10.255.245.46 set interfaces ip-2/1/0 unit 0 family inet address 10.22.22.22/24 set routing-options static route 10.1.1.1/32 next-hop gr-2/1/0.0 set routing-options static route 10.2.2.2/32 next-hop ip-2/1/0.0 set class-of-service interfaces ge-1/0/0 unit 0 rewrite-rules inet-precedence zf-tun-rw-ipprec-00 set class-of-service rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class best-effort loss-priority low code-point 000 set class-of-service rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class best-effort loss-priority high code-point 001 set class-of-service rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class expedited-forwarding loss-priority low code-point 010 set class-of-service rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class expedited-forwarding loss-priority high code-point 011 set class-of-service rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class assured-forwarding loss-priority low code-point 100 set class-of-service rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class assured-forwarding loss-priority high code-point 101 set class-of-service rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class network-control loss-priority low code-point 110 set class-of-service rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class network-control loss-priority high code-point 111 set class-of-service rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class best-effort loss-priority low code-point 000000 set class-of-service rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class best-effort loss-priority high code-point 001001 set class-of-service rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class expedited-forwarding loss-priority low code-point 010010 set class-of-service rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class expedited-forwarding loss-priority high code-point 011011 set class-of-service rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class assured-forwarding loss-priority low code-point 100100 set class-of-service rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class assured-forwarding loss-priority high code-point 101101 set class-of-service rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class network-control loss-priority low code-point 110110 set class-of-service rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class network-control loss-priority high code-point 111111 set firewall filter zf-catch-all term term1 then loss-priority high set firewall filter zf-catch-all term term1 then forwarding-class network-control
라우터 B
user@router-B# set interfaces ge-1/3/0 unit 0 family inet address 10.80.0.1/24 user@router-B# set interfaces lo0 unit 0 family inet address 10.255.245.46/32
라우터 C
set interfaces ge-1/0/0 unit 0 family inet address 10.90.0.1/24 set routing-options static route 10.1.1.1/32 next-hop 10.90.0.2 set routing-options static route 10.2.2.2/32 next-hop 10.90.0.2
라우터 A 구성
절차
단계별 절차
다음 예제에서는 구성 계층에서 다양한 수준의 탐색이 필요합니다. CLI 탐색에 대한 정보는 CLI 사용자 가이드의 구성 모드에서 CLI 편집기 사용을 참조하십시오.
다음을 참조하여 라우터 A를 구성하십시오.
디바이스 인터페이스를 구성합니다.
[edit interfaces] user@router-A# set ge-1/0/0 unit 0 family inet address 10.80.0.2/24 user@router-A# set ge-1/0/1 unit 0 family inet filter input zf-catch-all user@router-A# set ge-1/0/1 unit 0 family inet address address 10.90.0.2/24 user@router-A# set gr-2/1/0 unit 0 tunnel source 10.11.11.11 destination 10.255.245.46 user@router-A# set gr-2/1/0 unit 0 family inet address 10.21.21.21/24 user@router-A# set ip-2/1/0 unit 0 tunnel source 10.12.12.12 destination 10.255.245.46 user@router-A# set ip-2/1/0 unit 0 family inet address 10.22.22.22/24
정적 경로를 구성합니다.
[edit routing-options static] user@router-A# set static route 10.1.1.1/32 next-hop gr-2/1/0.0 user@router-A# set static route 10.2.2.2/32 next-hop ip-2/1/0.0
인터페이스에 재작성 규칙을 적용합니다.
[edit class-of-service] user@router-A# set interfaces ge-1/0/0 unit 0 rewrite-rules inet-precedence zf-tun-rw-ipprec-00
재작성 규칙을 정의합니다.
[edit class-of-service] user@router-A# set rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class best-effort loss-priority low code-point 000 user@router-A# set rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class best-effort loss-priority high code-point 001 user@router-A# set rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class expedited-forwarding loss-priority low code-point 010 user@router-A# set rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class expedited-forwarding loss-priority high code-point 011 user@router-A# set rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class assured-forwarding loss-priority low code-point 100 user@router-A# set rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class assured-forwarding loss-priority high code-point 101 user@router-A# set rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class network-control loss-priority low code-point 110 user@router-A# set rewrite-rules inet-precedence zf-tun-rw-ipprec-00 forwarding-class network-control loss-priority high code-point 111 user@router-A# set rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class best-effort loss-priority low code-point 000000 user@router-A# set rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class best-effort loss-priority high code-point 001001 user@router-A# set rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class expedited-forwarding loss-priority low code-point 010010 user@router-A# set rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class expedited-forwarding loss-priority high code-point 011011 user@router-A# set rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class assured-forwarding loss-priority low code-point 100100 user@router-A# set rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class assured-forwarding loss-priority high code-point 101101 user@router-A# set rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class network-control loss-priority low code-point 110110 user@router-A# set rewrite-rules dscp zf-tun-rw-dscp-00 forwarding-class network-control loss-priority high code-point 111111
방화벽 필터를 구성합니다.
[edit firewall] user@router-A# set filter zf-catch-all term term1 then loss-priority high user@router-A# set filter zf-catch-all term term1 then forwarding-class network-control
결과
구성 모드에서 , , show routing-options
show class-of-service
및 show firewall
명령을 입력show interfaces
하여 구성을 확인합니다. 출력에 의도한 구성이 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정합니다.
user@router-A# show interfaces ge-1/0/0 { unit 0 { family inet { address 10.80.0.2/24; } } } ge-1/0/1 { unit 0 { family inet { filter { input zf-catch-all; } address 10.90.0.2/24; } } } gr-2/1/0 { unit 0 { tunnel { source 10.11.11.11; destination 10.255.245.46; } family inet { address 10.21.21.21/24; } } } ip-2/1/0 { unit 0 { tunnel { source 10.12.12.12; destination 10.255.245.46; } family inet { address 10.22.22.22/24; } } }
user@router-A# show routing-options static { route 10.1.1.1/32 next-hop gr-2/1/0.0; route 10.2.2.2/32 next-hop ip-2/1/0.0; }
user@router-A# show class-of-service interfaces { ge-1/0/0 { unit 0 { rewrite-rules { inet-precedence zf-tun-rw-ipprec-00; } } } } rewrite-rules { inet-precedence zf-tun-rw-ipprec-00 { forwarding-class best-effort { loss-priority low code-point 000; loss-priority high code-point 001; } forwarding-class expedited-forwarding { loss-priority low code-point 010; loss-priority high code-point 011; } forwarding-class assured-forwarding { loss-priority low code-point 100; loss-priority high code-point 101; } forwarding-class network-control { loss-priority low code-point 110; loss-priority high code-point 111; } } } dscp zf-tun-rw-dscp-00 { forwarding-class best-effort { loss-priority low code-point 000000; loss-priority high code-point 001001; } forwarding-class expedited-forwarding { loss-priority low code-point 010010; loss-priority high code-point 011011; } forwarding-class assured-forwarding { loss-priority low code-point 100100; loss-priority high code-point 101101; } forwarding-class network-control { loss-priority low code-point 110110; loss-priority high code-point 111111; } }
user@router-A# show firewall filter zf-catch-all { term term1 { then { loss-priority high; forwarding-class network-control; } } }
디바이스 구성이 완료되면 구성 모드에서 을(를) 입력합니다 commit
.
라우터 B 구성
절차
단계별 절차
다음 예제에서는 구성 계층에서 다양한 수준의 탐색이 필요합니다. CLI 탐색에 대한 정보는 CLI 사용자 가이드의 구성 모드에서 CLI 편집기 사용을 참조하십시오.
다음을 참조하여 라우터 B를 구성하십시오.
디바이스 인터페이스를 구성합니다.
[edit interfaces] user@router-B# set ge-1/3/0 unit 0 family inet address 10.80.0.1/24 user@router-B# set lo0 unit 0 family inet address 10.255.245.46/32
결과
구성 모드에서 명령을 입력하여 구성을 확인합니다 show interfaces
. 출력에 의도한 구성이 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정합니다.
라우터 B
user@router-B# show interfaces ge-1/3/0 { unit 0 { family inet { address 10.80.0.1/24; } } } lo0 { unit 0 { family inet { address 10.255.245.46/32; } } }
디바이스 구성이 완료되면 구성 모드에서 을(를) 입력합니다 commit
.
라우터 C 구성
절차
단계별 절차
다음을 참조하여 라우터 C를 구성하십시오.
디바이스 인터페이스를 구성합니다.
[edit interfaces] user@router-B# set ge-1/0/0 unit 0 family inet address 10.90.0.1/24
정적 경로를 구성합니다.
[edit routing-options static] user@router-A# set static route 10.1.1.1/32 next-hop 10.90.0.2 user@router-A# set static route 10.2.2.2/32 next-hop 10.90.0.2
결과
구성 모드에서 및 show routing-options
명령을 입력하여 구성을 show interfaces
확인합니다. 출력에 의도한 구성이 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정합니다.
라우터 C
user@router-C show interfaces ge-1/0/0 { unit 0 { family inet { address 10.90.0.1/24; } } } user@router-C show routing-options static { route 10.1.1.1/32 next-hop 10.90.0.2; route 10.2.2.2/32 next-hop 10.90.0.2; }
디바이스 구성이 완료되면 구성 모드에서 을(를) 입력합니다 commit
.
확인
구성을 확인하려면 다음 명령을 실행합니다.