Some backpacks have built-in loops or clips designed specifically for this purpose, while others require that you attach some sort of carabiner or clip to the sides.