In a small bowl, stir together the salt, rosemary and fennel seeds. Rub the mixture all over the duck legs; place them in a sealable bag and refrigerate overnight.
Preheat the oven to 325°F.Remove the duck legs from the bag and brush off the salt mixture.
Place the duck legs, fat, garlic and shallots into a large, heavy pot or roasting pan. Cover tightly with a lid or aluminum foil and roast in the oven until the meat is tender and the fat has significantly rendered, about 2 hours. Let the duck cool to room temperature. It can sit, covered in all that fat, in the refrigerator for up to a month.
When you’re ready to eat the duck, remove it from the fat and either broil it on a rack set on a sheet pan until the skin is crisp, or brown and crisp it in a pan on the stovetop. You can also remove the skin from the duck confit, take the meat off of the bone, discard the bones, and warm the meat in a pan or in the oven before serving.