Advertisement
tirabytes

Juniper SRX: Class of Service

Jul 20th, 2011
1,707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.91 KB | None | 0 0
  1.  
  2. 88 88
  3. ,d "" 88 ,d
  4. 88 88 88
  5. MM88MMM 88 8b,dPPYba, ,adPPYYba, 88,dPPYba, 8b d8 MM88MMM ,adPPYba, ,adPPYba,
  6. 88 88 88P' "Y8 "" `Y8 88P' "8a `8b d8' 88 a8P_____88 I8[ ""
  7. 88 88 88 ,adPPPPP88 88 d8 `8b d8' 88 8PP""""""" `"Y8ba,
  8. 88, 88 88 88, ,88 88b, ,a8" `8b,d8' 88, "8b, ,aa aa ]8I
  9. "Y888 88 88 `"8bbdP"Y8 8Y"Ybbd8"' Y88' "Y888 `"Ybbd8"' `"YbbdP"'
  10. d8'
  11. ################################################## d8' ##### http://www.tirabytes.com/ ##
  12. -----
  13. Platform: Juniper
  14. OS: JunOS
  15. -----
  16.  
  17. edit class-of-service
  18.  
  19.  
  20. set classifiers dscp dscp-classifier forwarding-class network-control loss-priority high code-points 111000
  21. set classifiers dscp dscp-classifier forwarding-class network-control loss-priority low code-points 110000
  22.  
  23. set classifiers dscp dscp-classifier forwarding-class assured-forwarding loss-priority high code-points 100010
  24. set classifiers dscp dscp-classifier forwarding-class assured-forwarding loss-priority low code-points 011010
  25.  
  26. set classifiers dscp dscp-classifier forwarding-class expedited-forwarding loss-priority high code-points 101110
  27.  
  28. set classifiers dscp dscp-classifier forwarding-class best-effort loss-priority low code-points 000000
  29.  
  30.  
  31. set forwarding-classes queue 0 best-effort
  32. set forwarding-classes queue 1 expedited-forwarding
  33. set forwarding-classes queue 2 assured-forwarding
  34. set forwarding-classes queue 3 network-control
  35.  
  36.  
  37. set rewrite-rules dscp dscp-rewrite forwarding-class network-control loss-priority low code-point 110000
  38. set rewrite-rules dscp dscp-rewrite forwarding-class network-control loss-priority high code-point 111000
  39.  
  40. set rewrite-rules dscp dscp-rewrite forwarding-class expedited-forwarding loss-priority high code-point 101110
  41.  
  42. set rewrite-rules dscp dscp-rewrite forwarding-class assured-forwarding loss-priority high code-point 100010
  43. set rewrite-rules dscp dscp-rewrite forwarding-class assured-forwarding loss-priority low code-point 011010
  44.  
  45. set rewrite-rules dscp dscp-rewrite forwarding-class best-effort loss-priority low code-point 000000
  46.  
  47.  
  48. set scheduler-maps scheduler-cos forwarding-class expedited-forwarding scheduler real-time-applications
  49. set scheduler-maps scheduler-cos forwarding-class best-effort scheduler other-traffic
  50. set scheduler-maps scheduler-cos forwarding-class assured-forwarding scheduler important-applications
  51. set scheduler-maps scheduler-cos forwarding-class network-control scheduler network-protocols
  52.  
  53. set schedulers network-protocols transmit-rate percent 5
  54. set schedulers network-protocols buffer-size percent 5
  55. set schedulers network-protocols priority high
  56.  
  57. set schedulers important-applications transmit-rate percent 20
  58. set schedulers important-applications buffer-size percent 20
  59. set schedulers important-applications priority high
  60.  
  61. set schedulers real-time-applications transmit-rate percent 40
  62. set schedulers real-time-applications buffer-size percent 40
  63. set schedulers real-time-applications priority strict-high
  64.  
  65. set schedulers other-traffic transmit-rate percent 35
  66. set schedulers other-traffic buffer-size percent 35
  67. set schedulers other-traffic priority low
  68.  
  69.  
  70.  
  71. set interfaces fe-0/0/0 unit 0 scheduler-map hitech-cos
  72. set interfaces fe-0/0/0 unit 0 shaping-rate 1m
  73. set interfaces fe-0/0/0 unit 0 classifiers dscp dscp-classifier
  74. set interfaces fe-0/0/0 unit 0 rewrite-rules dscp dscp-rewrite
  75.  
  76. set interfaces fe-0/0/2 unit 0 scheduler-map hitech-cos
  77. set interfaces fe-0/0/2 unit 0 classifiers dscp dscp-classifier
  78. set interfaces fe-0/0/2 unit 0 rewrite-rules dscp dscp-rewrite
  79.  
  80. ## You will need to configure 'per-unit'scheduler'
  81.  
  82. top
  83.  
  84. set interface fe0/0/0 per-unit-scheduler
  85. set interface fe0/0/2 per-unit-scheduler
  86.  
  87.  
  88. ## If you're configuring sub-interfaces/VLAN you will need to create a "Virtual Channels".
  89.  
  90. set virtual-channels vlan1000
  91. set virtual-channels vlan2000
  92. set virtual-channels default
  93.  
  94. set virtual-channel-groups vcg-vlan1000 vlan1000 scheduler-map scheduler-cos
  95. set virtual-channel-groups vcg-vlan1000 vlan1000 shaping-rate 20m
  96. set virtual-channel-groups vcg-vlan1000 default scheduler-map scheduler-cos
  97. set virtual-channel-groups vcg-vlan1000 default default
  98.  
  99. set virtual-channel-groups vcg-vlan2000 vlan2000 scheduler-map scheduler-cos
  100. set virtual-channel-groups vcg-vlan2000 vlan2000 shaping-rate 20m
  101. set virtual-channel-groups vcg-vlan2000 default scheduler-map scheduler-cos
  102. set virtual-channel-groups vcg-vlan2000 default default
  103.  
  104.  
  105. ## Apply firewall filters to match specific traffic (VLAN/Virtual Channels)
  106.  
  107. top
  108. edit firewall
  109.  
  110. set family inet filter OUTBOUND-MPLS term REMOTE-VOIP from source-address 192.168.1.200/32
  111. set family inet filter OUTBOUND-MPLS term REMOTE-VOIP from destination-address 192.168.2.0/24
  112. set family inet filter OUTBOUND-MPLS term REMOTE-VOIP from destination-address 192.168.3.0/24
  113. set family inet filter OUTBOUND-MPLS term REMOTE-VOIP from destination-address 192.168.4.0/24
  114. set family inet filter OUTBOUND-MPLS term REMOTE-VOIP from destination-address 192.168.5.0/24
  115. set family inet filter OUTBOUND-MPLS term REMOTE-VOIP from destination-address dscp [ ef af31 ]
  116.  
  117. set family inet filter OUTBOUND-MPLS term REMOTE-VOIP then count OUTBOUND-MPLS-VOIP
  118. set family inet filter OUTBOUND-MPLS term REMOTE-VOIP then forwarding-class expedited-forwarding
  119. set family inet filter OUTBOUND-MPLS term REMOTE-VOIP then virtual-channel vlan1000
  120. set family inet filter OUTBOUND-MPLS term REMOTE-VOIP then accept
  121.  
  122. set family inet filter OUTBOUND-MPLS term OTHERS then virtual-channel vlan1000
  123. set family inet filter OUTBOUND-MPLS term OTHERS then accept
  124.  
  125. set family inet filter OUTBOUND-WWW term 2TALK from source-address 10.1.20.254/32
  126. set family inet filter OUTBOUND-WWW term 2TALK from source-address 10.1.10.254/32
  127.  
  128. set family inet filter OUTBOUND-WWW term 2TALK from destination-address 1.1.1.2/32
  129. set family inet filter OUTBOUND-WWW term 2TALK from destination-address 1.1.1.1/32
  130.  
  131. set family inet filter OUTBOUND-WWW term 2TALK from destination-port [ 5060 4569 ]
  132.  
  133. set family inet filter OUTBOUND-WWW term 2TALK then count OUTBOUND-WWW-VOIP
  134. set family inet filter OUTBOUND-WWW term 2TALK then forwarding-class expedited-forwarding
  135. set family inet filter OUTBOUND-WWW term 2TALK then virtual-channel vlan2000
  136. set family inet filter OUTBOUND-WWW term 2TALK then accept
  137.  
  138. set family inet filter OUTBOUND-WWW term OTHERS then virtual-channel vlan2000
  139. set family inet filter OUTBOUND-WWW term OTHERS then accept
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement