Is there an easy way to make a RigidBody2D collide with only one other RigidBody2D?

I need to make a RigidBody2D collide with only one other RigidBody2D and ignore collisions with every other RigidBody2D.

Only way I can think is to call Physics2D.IgnoreCollision() for every other collider. Not exactly an elegant solution.

You could try to tag both objects and ask if they collided or not.

void OnCollisionEnter (Collision col)
    {
        if(col.gameObject.tag == "mySpecialRigidBody2D")
        {
            // Do something.
        }
    }