Here is a copy of all of the configuration files, both initial and completed.

The server at 192.168.34.234 is running a webserver, tftp server, sshd, telnetd and iperf on port 9100 to emulate an HPJD printer.

The path for most packets will be R4 Fa0/0 -> R1 Fa0/0 -> R1 S0/0 -> R2 S0/0 -> R2 S2/1 -> R3 S2/1 -> 192.168.34.234. It will be done with both the traffic generator and from the command line on the routers.

To prepare for this lab only turn on one 800K link between R1 and R2, the serial link between R2 and R3 and the ethernet link for 192.168.34.3 on R3.

On R1:

Add tcp port 9100 as a custom protocol called jetdirect in NBAR. One of my routers had it, the other did not.

On the interface going to R2, S0/0, classify the traffic using NBAR.

Make a class-map named cmap-jetdirect for printing traffic using the custom protocol.

Make a policy-map named limit-jetdirect and apply it to S0/0 on R1 that includes the class-map from above.

On R2:

Add tcp port 9100 as a custom protocol in NBAR if needed.

Make a class-map named cmap-jetdirect using the custom protocol.

Make a class-map named cmap-http for HTTP traffic with a regular expression matching the word msi.

Make a policy-map named limit-drop and apply it to S0/0 on R1 that includes the class-maps from above and limits printing to 40Kbps.

Notes:

Make sure to run sh queue before and after the configuration on the routers.

You may or may not have the jetdirect service/protocol defined in NBAR.

Make sure to run sh ip nbar protocol-discovery after applying the routing policy.