It depends on what the term "illegitimate" means.
The term "illegitimate" is much more expansive than the Hebrew
term "Mamzer" which refers to a child born out of an incestuous
relationship or a child born to a married woman and a man not her
husband. The father has no obligation to a Mamzer. The father does
have an obligation to any other child that he fathers (regardless
if it falls within the Western definitions of legitimate or
illegitimate).