Junos OS

 View Only
last person joined: 18 hours ago 

Ask questions and share experiences about Junos OS.
  • 1.  Rewrite ip precedense

    Posted 08-27-2009 04:06

    As on Junose to rewrite value ip precedense,

    Example on Cisco

     

    class-map match-all be
        match ip precedence 0
    !
    !
    policy-map be
      class be
       set ip precedence 5
    !

    interface Ethernet0/0
     description out

     ip address 10.100.2.2 255.255.255.252
     ip directed-broadcast
     half-duplex
     service-policy output be

     

    As we see all simply

    thanks

     



  • 2.  RE: Rewrite ip precedense

    Posted 08-27-2009 04:32

    Hi,

     

    if you use your own forwarding classes then just replece the names. ge-0/0/0 is egress interface in this example. If it is a EX switch then you would need Junos 9.5 for this configuration.

     

    lab@M7i-loanunit-mpergament# show class-of-service
    interfaces {
        ge-0/0/0 {
            unit 0 {
                rewrite-rules {
                    inet-precedence ipprec0;
                }
            }
        }
    }
    rewrite-rules {
        inet-precedence ipprec0 {
            forwarding-class assured-forwarding {
                loss-priority low code-point 000;
                loss-priority high code-point 000;
            }

        inet-precedence ipprec0 {
            forwarding-class best-effort {
                loss-priority low code-point 000;
                loss-priority high code-point 000;
            }

        inet-precedence ipprec0 {
            forwarding-class expedited-forwarding {
                loss-priority low code-point 000;
                loss-priority high code-point 000;
            }

        inet-precedence ipprec0 {
            forwarding-class network-control {
                loss-priority low code-point 000;
                loss-priority high code-point 000;
            }
        }

     

    P.S. If it works for you then please mark it as worked solution + Kudo would be good.

     

    Regards

    Michael Pergament



  • 3.  RE: Rewrite ip precedense

    Posted 08-27-2009 04:36

    Btw this example would rewrite IP PREC for all forwarding classes to 0. Otherwise you could use default inet-precedence rewrite rule:

    lab@M7i-loanunit-mpergament# run show class-of-service rewrite-rule type inet-precedence
    Rewrite rule: ipprec-default, Code point type: inet-precedence, Index: 35
      Forwarding class                    Loss priority       Code point
      best-effort                         low                 000           
      best-effort                         high                000           
      expedited-forwarding                low                 101           
      expedited-forwarding                high                101           
      assured-forwarding                  low                 001           
      assured-forwarding                  high                001           
      network-control                     low                 110           
      network-control                     high                111   

     

    Which would actually rewrite all BE traffic to 0 per default!

     

    lab@M7i-loanunit-mpergament# set class-of-service interfaces ge-0/0/0 unit 0 rewrite-rules inet-precedence default 

     

    Regards

    Michael



  • 4.  RE: Rewrite ip precedense

    Posted 08-27-2009 05:31

    amtel@test1> show version
    Hostname: test1
    Model: j4350
    JUNOS Software Release [8.5R1.13] (Export edition

     

    class-of-service {
        forwarding-classes {
            queue 0 f0;
            queue 1 f1;
            queue 2 f2;
    ---     queue 3 f3;
            queue 4 f4;
            queue 5 f5;
            queue 6 f6;
            queue 7 f7;
        }
        interfaces {
            ge-0/0/1 {
                unit 0 {
                    scheduler-map map;
                    shaping-rate 10m;
                    rewrite-rules {
                        dscp BE;
                    }
                }
            }
        }
        rewrite-rules {
            dscp BE {
                forwarding-class f1 {
                    loss-priority high code-point 000000;
                }
            }
                           }
        scheduler-maps {
            map {
                forwarding-class f0 scheduler F0;
                forwarding-class f1 scheduler F1;
                forwarding-class f2 scheduler F2;
                forwarding-class f3 scheduler F3;
                forwarding-class f4 scheduler F4;
                forwarding-class f5 scheduler F5;
                forwarding-class f6 scheduler F6;
                forwarding-class f7 scheduler F7;
            }
        }
        schedulers {
            F0 {
                transmit-rate percent 30;
                buffer-size percent 10;
                priority low;
            }
            F1 {
                transmit-rate percent 10;
                buffer-size percent 10;
                priority low;
                               }
            F2 {
                transmit-rate percent 10;
                buffer-size percent 10;
                priority low;
            }
            F3 {
                transmit-rate percent 10;
                buffer-size percent 10;
                priority low;
            }
            F4 {
                transmit-rate percent 10;
                buffer-size percent 10;
                priority medium-high;
            }
            F5 {
                transmit-rate percent 10;
                buffer-size percent 10;
                priority medium-high;
            }
            F6 {
                transmit-rate percent 10;
                buffer-size percent 10;
                priority medium-low;
            }
            F7 {
                transmit-rate percent 10;
                buffer-size percent 5;
                priority strict-high;
            }



  • 5.  RE: Rewrite ip precedense

    Posted 08-27-2009 05:37

    firewall {
        family inet {
            filter BE {
                term 1 {
                    from {
                        dscp [ cs5 ef ];
                    }
                    then {
                        loss-priority medium-low;
                        forwarding-class f1;
                        accept;
                    }
                }

     

          
    No works -(((


    #to
    #DSCP
    #not
    #try
    #i
    #does
    #fulfil
    #rewrite


  • 6.  RE: Rewrite ip precedense

    Posted 08-27-2009 05:41

    on which ingress interface did you apply this filter? Did you apply it at all?

     

    Regards

    Michael



  • 7.  RE: Rewrite ip precedense

    Posted 08-27-2009 05:50

    Yes

     

    interfaces {
    ge-0/0/0 {
            unit 0 {
                family inet {
                    filter {
                        input BE;
                    }
                    address 10.200.27.3/24 {
                        vrrp-group 1 {
                            virtual-address 10.200.27.1;
                            priority 120;
                            no-preempt;
                        }

     

     

     Queue counters:       Queued packets  Transmitted packets      Dropped packets
        0 f0                             0                    0                    0
        1 f1                            64                   64                    0
        2 f2                             0                    0                    0
        3 f3                             0                    0                    0
        4 f4                             0                    0                    0
        5 f5                             0                    0                    0
        6 f6                             0                    0                    0
        7 f7                             0                    0                    0
      Active alarms  : None
      Active defects : None

     

    Packages get to f1 interf-ge-0/0/1

     



  • 8.  RE: Rewrite ip precedense

    Posted 08-27-2009 05:57

    Ok. So what does not work (traffic is going out on the right queue according toyour FF)? Rewriting? You assigned loss-prio medium-low within your FF but use prio highwithin rewrite-rule which is not really consistent! Change  loss-prio within your FF to higg then you would see rewriting at work.

     

    Regards

    Michael Pergament



  • 9.  RE: Rewrite ip precedense

    Posted 08-27-2009 06:06
    Many thanks, work !!!!!!!!!!!!!!!!!!!!!!!!!!!!Smiley Happy


  • 10.  RE: Rewrite ip precedense
    Best Answer

    Posted 08-27-2009 06:08

    Please mark it as a Working Solution. Thanks!

     

    Michael Pergament