3

Let's say I want:

routing-options {
  forwarding-table {
    export SORTER
  }
}

policy-options {
  policy-statement SORTER {
    term by-Comm {
      to community Comm-list;
      then {
        destination-class FOO;
        accept;
      }
    }
  }
}

An I can't get it working. Is it ever possible?

I've read the docs thouroughly and set accounting destination-class-usage properly I do believe.

An I have from community Comm-list and then source-class working (in the opposite direction) --- UPDATE:

So, my setup is like this: I have an MX80, a bunch of clients behind it, connection to the Internet, BGP peering with a core router (cisco let's say). My junos router already has loaded with fullview, there are communities <ASN>:1 --- these prefixes are "the wild world" --- and <ASN:2> --- these are "to local IX networks".

I have defined the SORTER and community lists like this:

policy-options {
  policy-statement SORTER {
    term World {
      from community World;
      then {
        source-class World;
        accept;
      }
    }
  }

  ...
  community Exchange members <ASN>:2;
  community World members <ASN>:1;
}

With this statements --- and, of course, appropriate accounting { source-class-usage { ... } } in appropriate places --- I can see counters on clients' interfaces (defined as VLAN units under some xe-0/0/0).

So, I really can see these counters, they're correct (I'm using them for downstream traffic policing, I can graph them).

After this I've set interface xe-0/0/0 unit <OUTPUT_VID> family inet accounting destination-class-usage and defined a policy as I've described above (the very first code fragment), with to community World then destination-class World.

And I want to see that counter working .)

6