From here, we start having divergent opinions. "Even until the tenth generation" is interpreted as "forever," but Resh Lakish says it literally means the tenth generation. They asked Rabbi Eliezer's opinion on this, but he answered, "Who can give me even the third generation mamzer, and I will purify him." He meant that Heaven watches over him and causes him to die before he produces the third generation - so that the Jews would not unknowingly intermarry.
That rule only applies to a mamzer who was not known publicly. But if he is known, people would not intermarry anyway. To support this, here is a story. There was one mamzer whose status was not known. Rabbi Ami announced his status to the public. The man went about crying. Rabbi Ami consoled him, "I gave you life!"
Rabbi Tarfon tells us how a mamzer can purify himself. Today, it is hard to prove that anyone is a mamzer.
Art: Two Sisters and a Brother of the Artist by Sofonisba Anguissola