I would like to revisit your question, now in the form of an answer. First, because I made a typo in my initial comment. Second, because later on I was mischaracterized and explicitly encouraged to post an answer. Here I will avoid question marks so that to the trained eye this looks like an answer rather than an unrelated question.
How does God know that He is eternal?
We cannot ascertain even whether God knows that. This question and the rationale upon which it is premised entail assumptions which warrant some scrutiny.
God must know that He is eternal in order to promise eternal life
Not necessarily. An ordinary person has the ability to make a promise with the intent to deceive (the promissor's mortality does not prevent him from making to others a promise of immortality or of eternal life). A denial that also God possesses the ability to deceive would clearly contradict any consensus that God is mightier or more capable than an ordinary person. Therefore, the sole promise of eternal life does not imply that the promissor knows that he (or He, accordingly) is eternal.
How does He know that He is eternal when forever hasn't and can't be reached?
At the outset, the question itself impliedly negates any and all possibilities that God has reached or can reach the forever. I would not be surprised by the pervasiveness of debate about God's possibilities on this matter, but I will ignore it altogether because I think it sheds no light on the core issue: God's knowledge about His eternity.
The notion that "God knows that He is eternal" inevitably implies at least one of these scenarios:
- God's information and belief [that He is eternal] is inaccurate; or
- God is unable to alter or elude the "destiny" designated --arguably
by Himself-- to Him: His eternity.
The first scenario would preempt the core question on grounds that He is not eternal. In that case, His alleged knowledge about His own eternity is a doomed presumption.
The second scenario means, in particular, that God would fail each and every attempt of suicide (meaning His suicide) no matter how eagerly and how frequently He tries. That contradicts the notion of His omnipotence. Without omnipotence, God cannot ensure others' eternal life. That implies that His promise of eternal life is unreliable. In turn, the unreliability of His promise(s) weakens His credibility on anything else that He purports to know. Therefore, we cannot ascertain whether He knows about a given topic.
One fundamental problem with absolutist theologies is that their unrestrained idealizations wipe out the chances of a dogma's survival when its philosophical significance is assessed. Anyone is free to disagree --on grounds of faith and mysticism-- with the uncomfortable conclusions reached through the intellect. But it is important not mischaracterize as intransigence (or with reproaches such as "You need to allow people to disagree") when an intellectual assessment leads to conclusions that depart from dogmatic doctrine.