For a 2U device, normally I cut up a 4x4 and mount blocks (front and back for side air flow) or lengths (for front/rear airflow) to the wall (appropriate bolts/screws/anchors based on the wall).
I mount the device "horizontally" so that no cables are hanging down (to vibrate loose or to be unplugged as in one case when someone need a place to "hang something") and so dust and debris does not accumulate in upward facing ports.
I do use the ears and screw the device to the 4x4s. Depending on how much traffic in the area, I will mount plywood strips between the 4x4s across the device to secure it and/or a piece of plywood to protect it. Plywood can also help to conceal if visibility is a concern.
Keep air flow in mind, both with spacing and the direction of exhaust. Since it is wood, you should drill pilot holes to prevent splitting. If you are paranoid (or have a boss/client who is), you can use FRT (fire retardant treated) wood, but it isn't necessary.
Growing up with my father who worked with wood quite a bit, I sometimes go a bit crazy, using a sliding dovetail or hidden dovetail bracket on the wall to mount the 4x4. Always thought it might be fun to turn one into a wall mounted book shelf at some point.