Put the duck in a large, heavy pot and cover with water. Add the quartered onion, garlic cloves, 2 teaspoons of the salt, and the red pepper flakes. Bring to a boil, then reduce the heat to medium, partially cover, and cook for 2 hours. Remove the duck, transfer to a platter, and let cool.
Remove the skin from the duck and pick the meat off the bones, discarding the skin and bones. Shred the meat and set aside.
Strain the duck broth through a fine-mesh sieve. You should have about 2 1/2 quarts. Add enough water to make 3 quarts. Set aside.
In a large, heavy pot over medium-high heat, fry the bacon until slightly crisp, about 7 minutes. Add the chopped onions, celery, carrots, the remaining 1 teaspoon salt, the black pepper, and bay leaves. Cook, stirring, until the vegetables are slightly soft, about 3 minutes. Add the chopped garlic and beans and cook, stirring, for 2 minutes.
Add the reserved duck broth and bring to a boil. Reduce the heat to medium and simmer, uncovered, until the beans are tender, about 1 1/2 hours.
Remove and discard the bay leaves. Add the duck meat and heat for about 2 minutes. Serve hot in soup bowls.
Yield: about 8 servings