If an attorney knows that his client intends to or does engage in unlawful conduct during his representation, things get complicated for the lawyer who will presumably know this stuff. It would be illegal for a client to testify falsely, so if the client intends to perjure himself, the lawyer should diligently act to counsel to not lie under oath. There is no law requiring a client to confess or provide incriminating evidence (in lieu of a subpoena), so if the client plans to just sit quietly and let the attorney do the talking, then the lawyer is doing his job and he will not be punished, even if it is somehow discovered that the client is actually guilty.
The lawyer might have advance reason to believe that the client intends to commit perjury, so might not allow the client to testify. That happened in the case People v. Johnson, 62 Cal. App. 4th 608. Johnson's conviction was overturned because he was denied the right to testify in his own defense (Rock v. Arkansas, 483 U.S. 44). The Johnson court discusses various options for resolving the client-rights vs. attorney-obligation conflict, including the "narrative option", where the attorney does not ask questions, but rather allows the client to freely narrate events, and then the attorney does not rely on any false testimony. The court concluded that the narrative option is the best resolution of these conflicts. Disallowing client testimony is a denial of the right of the defendant to testify.
Another possibility is that, like Lowery v. Cardwell, 575 F.2d 727, a client might surprise the attorney with false testimony. In this case, the attorney sought (in chambers) to withdraw from the case (denied), and then did not further question the defendant. While the attorney's motivation was ethically admirable, the court found that it was prejudicial against the client, concluding that the attorney's action "amounted to such an unequivocal announcement to the fact finder as to deprive appellant of due process".
If an attorney were to encourage a client to commit perjury, they could be disbarred. But generally, the rule is that it is the prosecution's duty to prove that the accused is guilty, and not the defendant's duty (or the defendant's attorney).