4

In Cisco, this can be easily achieved by:

policy-map TVPrio
 description Set VLAN priority to 4
 class class-default
  set cos 4

and apply this policy-map to the interface. How to do equivalent in JunOS?

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 11 '17 at 3:32
  • @RonMaupin Thanks for reminding. I always accept the answer which is working. However, as I replied in each answers, they does not work for my question, thus I didn't mark any of them. – Lingfeng Xiong Aug 13 '17 at 5:55
2

You have to set all forwarding-classes to the same code-point:

set class-of-service rewrite-rules ieee-802.1 all-to-cos-4 forwarding-class assured-forwarding loss-priority low code-point 100
set class-of-service rewrite-rules ieee-802.1 all-to-cos-4 forwarding-class assured-forwarding loss-priority high code-point 100
set class-of-service rewrite-rules ieee-802.1 all-to-cos-4 forwarding-class expedited-forwarding loss-priority high code-point 100
set class-of-service rewrite-rules ieee-802.1 all-to-cos-4 forwarding-class expedited-forwarding loss-priority low code-point 100
set class-of-service rewrite-rules ieee-802.1 all-to-cos-4 forwarding-class network-control loss-priority low code-point 100
set class-of-service rewrite-rules ieee-802.1 all-to-cos-4 forwarding-class network-control loss-priority high code-point 100
set class-of-service rewrite-rules ieee-802.1 all-to-cos-4 forwarding-class best-effort loss-priority high code-point 100
set class-of-service rewrite-rules ieee-802.1 all-to-cos-4 forwarding-class best-effort loss-priority low code-point 100

Then apply this to the interface(s) you want to change the CoS bits:

set class-of-service interfaces ge-0/0/0 unit 0 rewrite-rules ieee-802.1 all-to-cos-4

Mind you that this is only for the default forwarding-classes. If you have defined your own forwarding-classes you have to do it for these as well.

| improve this answer | |
  • The rewrite-rules only works for forwarded traffic, not for routing engine generated traffic, for example, the DHCP request. – Lingfeng Xiong Jun 7 '15 at 13:34
1

Late to the party on this one, but to override RE-generated CoS values, you can use:

set class-of-service host-outbound-traffic forwarding-class <FORWARDING-CLASS>

Then set your re-write rules for that forwarding-class appropriately.

If you are happy with just DSCP markings, you can assign these statically using:

set class-of-service host-outbound-traffic dscp-code-point <DSCP-CODEPOINT>
| improve this answer | |
  • Hi Benjamin, this method does work for DSCP override, but it overrides all traffic sent from RE. And I only need to override RE traffic from one single interface, not all of them... – Lingfeng Xiong May 4 '16 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.