Lineage of a child born through marrying one's mahram

Q: If a person married his mahram and children were then born from this relationship, will the nasab (lineage) of the children be established from the father? Likewise, will the ruling be the same in the situation where a person married a woman who was haraam upon him because of hurmat-e-musaaharah, ridaa'at, etc. Also, can mufti saheb please explain if there is any difference in the ruling if the husband knew that she was haraam or didn't know?