In a small saucepan, combine the sugar, water, star anise, and cinnamon sticks over medium heat. Bring to a boil, reduce the heat, and simmer, stirring occasionally, until the sugar has dissolved, about 5 minutes. Remove the pan from the heat and allow the syrup to cool, about 1 hour. Strain the syrup into a large pitcher and refrigerate until ready to serve. Slowly pour the beer into the pitcher. Stir and serve.