Select Page

VOICE-vlan | CoS

CONFIGURATION

Voice VLAN:

[edit ethernetswitching-options]

[email protected]# show
voip {
    interface ge-0/0/9 {
        vlan voice;
        forwarding-class voice;
    }
interface ge-0/0/10 {
        vlan voice;
        forwarding-class voice;
}
    } interface ge-0/0/11{
        vlan voice;
        forwarding-class voice;
    }
}

  • Voice VLAN MonitoringTo monitor voice VLAN, use the show vlans detail <vlan-name> command. This command shows voice VLAN details such as membership, tag, and state information.

    [email protected]> show vlans detail voice
    vlan voice:
        Admin state :      Enabled
        Tagging     :      802.1Q Tag 500
        Description :      None
        Primary IP  :      None
        STP         :      None
        Tag         :      ge-0/0/9.0
                           ge-0/0/10.0*
                           ge-0/0/11.0                    * - Active
        Untag       :      None

To quickly configure CoS, copy the following commands and paste them into the switch terminal window:

[edit]
set class-of-service forwarding-classes class app queue-num 5
set class-of-service forwarding-classes class mail queue-num 1
set class-of-service forwarding-classes class db queue-num 2
set class-of-service forwarding-classes class erp queue-num 3
set class-of-service forwarding-classes class video queue-num 4
set class-of-service forwarding-classes class best-effort queue-num 0
set class-of-service forwarding-classes class voice queue-num 6
set class-of-service forwarding-classes class network-control queue-num 7
set firewall family ethernet-switching filter voip_class term voip from source-address 192.168.1.1/28
set firewall family ethernet-switching filter voip_class term voip from source-address 192.168.1.2/28
set firewall family ethernet-switching filter voip_class term voip from protocol udp
set firewall family ethernet-switching filter voip_class term voip from source-port 2698
set firewall family ethernet-switching filter voip_class term voip then forwarding-class voice loss-priority low
set firewall family ethernet-switching filter voip_class term network_control from precedence [net-control internet-control]
set firewall family ethernet-switching filter voip_class term network_control then forwarding-class network-control loss-priority low
set firewall family ethernet-switching filter voip_class term best_effort_traffic then forwarding-class best-effort loss-priority low
set interfaces ge-0/0/0 description phone1–voip-ingress-port
set interfaces ge-0/0/0 unit 0 family ethernet-switching filter input voip_class
set class-of-service interfaces ge-0/0/0 shaping-rate 100m
set interfaces ge-0/0/1 description phone2–voip-ingress-port
set interfaces ge-0/0/1 unit 0 family ethernet-switching filter input voip_class
set firewall family ethernet-switching filter video_class term video from source-address 192.168.1.17/28
set firewall family ethernet-switching filter video_class term video from protocol udp
set firewall family ethernet-switching filter video_class term video from source-port 2979
set firewall family ethernet-switching filter video_class term video then forwarding-class video loss-priority low
set firewall family ethernet-switching filter video_class term network_control from precedence [net-control internet-control]
set firewall family ethernet-switching filter video_class term network_control then forwarding-class network-control loss-priority low
set firewall family ethernet-switching filter video_class term best_effort_traffic then forwarding-class best-effort loss-priority low
set interfaces ge-0/0/2 description video-ingress-port
set interfaces ge-0/0/2 unit 0 family ethernet-switching filter input video_class
set firewall family ethernet-switching filter app_class term app from source-address 192.168.1.33/28
set firewall family ethernet-switching filter app_class term app from protocol tcp
set firewall family ethernet-switching filter app_class term app from source-port [1494 2512 2513 2598 2897]
set firewall family ethernet-switching filter app_class term app then forwarding-class app loss-priority low
set firewall family ethernet-switching filter app_class term mail from source-address 192.168.1.34/28
set firewall family ethernet-switching filter app_class term mail from protocol tcp
set firewall family ethernet-switching filter app_class term mail from source-port [25 143 389 691 993 3268 3269]
set firewall family ethernet-switching filter app_class term mail then forwarding-class mail loss-priority low
set firewall family ethernet-switching filter app_class term db from source-address 192.168.1.35/28
set firewall family ethernet-switching filter app_class term db from protocol tcp
set firewall family ethernet-switching filter app_class term db from source-port [1521 1525 1527 1571 1810 2481]
set firewall family ethernet-switching filter app_class term db then forwarding-class db loss-priority low
set firewall family ethernet-switching filter app_class term erp from source-address 192.168.1.36/28
set firewall family ethernet-switching filter app_class term erp from protocol tcp
set firewall family ethernet-switching filter app_class term erp from source-port [3200 3300 3301 3600]
set firewall family ethernet-switching filter app_class term erp then forwarding-class erp loss-priority low
set firewall family ethernet-switching filter app_class term network_control from precedence [net-control internet-control]
set firewall family ethernet-switching filter app_class term network_control then forwarding-class network-control loss-priority low
set firewall family ethernet-switching filter app_class term best_effort_traffic then forwarding-class best-effort loss-priority low
set interfaces ge-0/0/3 unit 0 family ethernet-switching filter input app_class
set interfaces ge-0/0/4 unit 0 family ethernet-switching filter input app_class
set interfaces ge-0/0/5 unit 0 family ethernet-switching filter input app_class
set interfaces ge-0/0/6 unit 0 family ethernet-switching filter input app_class
set class-of-service schedulers voice-sched shaping-rate percent 10
set class-of-service schedulers voice-sched buffer-size percent 10
set class-of-service schedulers voice-sched priority strict-high
set class-of-service schedulers video-sched priority low
set class-of-service schedulers video-sched transmit-rate percent 15
set class-of-service schedulers app-sched buffer-size percent 10
set class-of-service schedulers app-sched priority low
set class-of-service schedulers app-sched transmit-rate percent 10
set class-of-service schedulers mail-sched buffer-size percent 5
set class-of-service schedulers mail-sched priority low
set class-of-service schedulers mail-sched transmit-rate percent 5
set class-of-service schedulers db-sched buffer-size percent 10
set class-of-service schedulers db-sched priority low
set class-of-service schedulers db-sched transmit-rate percent 10
set class-of-service schedulers erp-sched buffer-size percent 10
set class-of-service schedulers erp-sched priority low
set class-of-service schedulers erp-sched transmit-rate percent 10
set class-of-service schedulers nc-sched shaping-rate percent 5
set class-of-service schedulers nc-sched buffer-size percent 5
set class-of-service schedulers nc-sched priority strict-high
set class-of-service schedulers be-sched buffer-size percent 35
set class-of-service schedulers be-sched priority low
set class-of-service schedulers be-sched transmit-rate percent 35
set class-of-service scheduler-maps ethernet-cos-map forwarding-class voice scheduler voice-sched
set class-of-service scheduler-maps ethernet-cos-map forwarding-class video scheduler video-sched
set class-of-service scheduler-maps ethernet-cos-map forwarding-class app scheduler app-sched
set class-of-service scheduler-maps ethernet-cos-map forwarding-class mail scheduler mail-sched
set class-of-service scheduler-maps ethernet-cos-map forwarding-class db scheduler db-sched
set class-of-service scheduler-maps ethernet-cos-map forwarding-class erp scheduler erp-sched
set class-of-service scheduler-maps ethernet-cos-map forwarding-class network-control scheduler nc-sched
set class-of-service scheduler-maps ethernet-cos-map forwarding-class best-effort scheduler be-sched
set class-of-service interfaces ge-0/0/20 scheduler-map ethernet-cos-map
set class-of-service interfaces ge-0/0/21 scheduler-map ethernet-cos-map
set class-of-service schedulers voice-sched-queue-shap shaping-rate 30m
set class-of-service scheduler-maps sched-map-be forwarding-class best-effort scheduler voice-sched-queue-shap
set class-of-service interfaces ge-0/0/2 scheduler-map sched-map-be

Step-by-Step Procedure

To configure and apply CoS:

  1. Configure one-to-one mappings between eight forwarding classes and eight queues:
    [edit class-of-service]
    [email protected]set forwarding-classes class app queue-num 5
    [email protected]set forwarding-classes class mail queue-num 1
    [email protected]set forwarding-classes class db queue-num 2
    [email protected]set forwarding-classes class erp queue-num 3
    [email protected]set forwarding-classes class video queue-num 4
    [email protected]set forwarding-classes class best-effort queue-num 0
    [email protected]set forwarding-classes class voice queue-num 6
    [email protected]set forwarding-classes class network-control queue-num 7
  2. Define the firewall filter voip_class to classify the VoIP traffic:
    [edit firewall]
    [email protected]set family ethernet-switching filter voip_class
  3. Define the term voip:
    [edit firewall]
    [email protected]set family ethernet-switching filter voip_class term voip from source-address 192.168.1.1/28
    [email protected]set family ethernet-switching filter voip_class term voip from source-address 192.168.1.2/28
    [email protected]set family ethernet-switching filter voip_class term voip protocol udp
    [email protected]set family ethernet-switching filter voip_class term voip source-port 2698
    [email protected]set family ethernet-switching filter voip_class term voip then forwarding-class voice loss-priority low
  4. Define the term network_control (for the voip_class filter):
    [edit firewall]
    [email protected]set family ethernet-switching filter voip_class term network_control from precedence [net-control internet-control]
    [email protected]set family ethernet-switching filter voip_class term network_control then forwarding-class network-control loss-priority low
  5. Define the term best_effort_traffic with no match conditions (for the voip_class filter):
    [edit firewall]
    [email protected]set family ethernet-switching filter voip_class term best_effort_traffic then forwarding-class best-effort loss-priority low
  6. Apply the firewall filter voip_class as an input filter to the interfaces for the VoIP phones:
    [edit interfaces]
    [email protected]set ge-0/0/0 description phone1-voip-ingress-port
    [email protected]set ge-0/0/0 unit 0 family ethernet-switching filter input voip_class
    [email protected]set ge-0/0/1 description phone2-voip-ingress-port
    [email protected]set ge-0/0/1 unit 0 family ethernet-switching filter input voip_class
  7. Apply port shaping on the interface ge-0/0/0:
    [edit]
    [email protected]set class-of-service interfaces ge-0/0/0 shaping-rate 100m
  8. Define the firewall filter video_class to classify the video traffic:
    [edit firewall]
    [email protected]set family ethernet-switching filter video_class
  9. Define the term video:
    [edit firewall]
    [email protected]set family ethernet-switching filter video_class term video from source-address 192.168.1.17/28
    [email protected]set family ethernet-switching filter video_class term video protocol udp
    [email protected]set family ethernet-switching filter video_class term video source-port 2979
    [email protected]set family ethernet-switching filter video_class term video then forwarding-class video loss-priority low
  10. Define the term network_control (for the video_class filter):
    [edit firewall]
    [email protected]set family ethernet-switching filter video_class term network_control from precedence [net-control internet-control]
    [email protected]set family ethernet-switching filter video_class term network_control then forwarding-class network-control loss-priority low
  11. Define the term best_effort_traffic with no match conditions (for the video_class filter):
    [edit firewall]
    [email protected]set family ethernet-switching filter video_class term best_effort_traffic then forwarding-class best-effort loss-priority low
  12. Apply the firewall filter video_class as an input filter to the interface for the surveillance camera:
    [edit interfaces]
    [email protected]set ge-0/0/2 description video-ingress-port
    [email protected]set ge-0/0/2 unit 0 family ethernet-switching filter input video_class
  13. Define the firewall filter app_class to classify the application server traffic:
    [edit firewall]
    [email protected]set family ethernet-switching filter app_class
  14. Define the term app (for the app_class filter):
    [edit firewall]
    [email protected]set family ethernet-switching filter app_class term app from source-address 192.168.1.33/28
    [email protected]set family ethernet-switching filter app_class term app protocol tcp
    [email protected]set family ethernet-switching filter app_class term app source-port [1494 2512 2513 2598 2897]
    [email protected]set family ethernet-switching filter app_class term app then forwarding-class app loss-priority low
  15. Define the term mail (for the app_class filter):
    [edit firewall]
    [email protected]set family ethernet-switching filter app_class term mail from source-address 192.168.1.34/28
    [email protected]set family ethernet-switching filter app_class term mail protocol tcp
    [email protected]set family ethernet-switching filter app_class term mail source-port [25 143 389 691 993 3268 3269]
    [email protected]set family ethernet-switching filter app_class term mail then forwarding-class mail loss-priority low
  16. Define the term db (for the app_class filter):
    [edit firewall]
    [email protected]set family ethernet-switching filter app_class term db from source-address 192.168.1.35/28
    [email protected]set family ethernet-switching filter app_class term db protocol tcp
    [email protected]set family ethernet-switching filter app_class term db source-port [1521 1525 1527 1571 1810 2481]
    [email protected]set family ethernet-switching filter app_class term db then forwarding-class db loss-priority low
  17. Define the term erp (for the app_class filter):
    [edit firewall]
    [email protected]set family ethernet-switching filter app_class term erp from source-address 192.168.1.36/28
    [email protected]set family ethernet-switching filter app_class term erp protocol tcp
    [email protected]set family ethernet-switching filter app_class term erp source-port [3200 3300 3301 3600]
    [email protected]set family ethernet-switching filter app_class term erp then forwarding-class erp loss-priority low
  18. Define the term network_control (for the app_class filter):
    [edit firewall]
    [email protected]set family ethernet-switching filter app_class term network_control from precedence [net-control internet-control]
    [email protected]set family ethernet-switching filter app_class term network_control then forwarding-class network-control loss-priority low
  19. Define the term best_effort_traffic (for the app_class filter):
    [edit firewall]
    [email protected]set family ethernet-switching filter app_class term best_effort_traffic then forwarding-class best-effort loss-priority low
  20. Apply the firewall filter app_class as an input filter to the interfaces for the servers hosting applications:
    [edit interfaces]
    [email protected]set ge-0/0/3 unit 0 family ethernet-switching filter input app_class
    [email protected]set ge-0/0/4 unit 0 family ethernet-switching filter input app_class
    [email protected]set ge-0/0/5 unit 0 family ethernet-switching filter input app_class
    [email protected]set ge-0/0/6 unit 0 family ethernet-switching filter input app_class
  21. Configure schedulers:
    [edit class-of-service]
    [email protected]set schedulers voice-sched shaping-rate percent 10
    [email protected]set schedulers voice-sched buffer-size percent 10
    [email protected]set schedulers voice-sched priority strict-high
    [email protected]set schedulers video-sched priority low
    [email protected]set schedulers video-sched transmit-rate percent 15
    [email protected]set schedulers app-sched buffer-size percent 10
    [email protected]set schedulers app-sched priority low
    [email protected]set schedulers app-sched transmit-rate percent 10
    [email protected]set schedulers mail-sched buffer-size percent 5
    [email protected]set schedulers mail-sched priority low
    [email protected]set schedulers mail-sched transmit-rate percent 5
    [email protected]set schedulers db-sched buffer-size percent 10
    [email protected]set schedulers db-sched priority low
    [email protected]set schedulers db-sched transmit-rate percent 10
    [email protected]set schedulers erp-sched buffer-size percent 10
    [email protected]set schedulers erp-sched priority low
    [email protected]set schedulers erp-sched transmit-rate percent 10
    [email protected]set schedulers nc-sched shaping-rate percent 5
    [email protected]set schedulers nc-sched buffer-size percent 5
    [email protected]set schedulers nc-sched priority strict-high
    [email protected]set schedulers nc-sched transmit-rate percent 5
    [email protected]set schedulers be-sched buffer-size percent 35
    [email protected]set schedulers be-sched priority low
    [email protected]set schedulers be-sched transmit-rate percent 35
  22. Assign the forwarding classes to schedulers with the scheduler map ethernet-cos-map:
    [edit class-of-service]
    [email protected]set scheduler-maps ethernet-cos-map forwarding-class voice scheduler voice-sched
    [email protected]set scheduler-maps ethernet-cos-map forwarding-class video scheduler video-sched
    [email protected]set scheduler-maps ethernet-cos-map forwarding-class app scheduler app-sched
    [email protected]set scheduler-maps ethernet-cos-map forwarding-class mail scheduler mail-sched
    [email protected]set scheduler-maps ethernet-cos-map forwarding-class db scheduler db-sched
    [email protected]set scheduler-maps ethernet-cos-map forwarding-class erp scheduler erp-sched
    [email protected]set scheduler-maps ethernet-cos-map forwarding-class network-control scheduler nc-sched
    [email protected]set scheduler-maps ethernet-cos-map forwarding-class best-effort scheduler be-sched
  23. Associate the scheduler map with the outgoing interfaces:
    [edit class-of-service interfaces]
    [email protected]set ge-0/0/20 scheduler-map ethernet-cos-map
    [email protected]set ge-0/0/21 scheduler-map ethernet-cos-map
  24. Apply queue shaping for the best-effort queue:
    [edit]
    [email protected]set class-of-service schedulers voice-sched-queue-shap shaping-rate 30m
    [email protected]set class-of-service scheduler-maps sched-map-be forwarding-class best-effort scheduler voice-sched-queue-shap
    [email protected]set class-of-service interfaces ge-0/0/2 scheduler-map sched-map-be
 

The Juniper All-Access | Reading List

Leave a reply

Your email address will not be published. Required fields are marked *

Share on print
Print
Share on google
Google+
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

ADENTECH guides

We love to help.

Get our newsletter, join the community: