There’s a lot that’s not specified here, so I’ll have to make a few assumptions. My first assumption, of course, is that you had a good intentions using different IDs on the same forum, and that you you’re not trying to deceive someone. (See my rant on ethics if you wonder why I care.)
Depending on things, I can hypothesize several different ways to tell it’s you, and not all involve IP addresses.
Become a Patron of Ask Leo! and go ad-free!
Identifying users on online forums
There are multiple ways someone could identify you using different IDs on the same forum. They could be an admin who sees IP addresses, or they might track cookies or notice your writing style. Forum software and settings can also play a role.
You didn’t indicate which forum, or more importantly, which forum software is in use. It’s quite possible that the forum software may not display your IP address, but could still embed it in the HTML. A “view, Source” of the a forum page will tell you that quick enough.
The forum software might make the IP address information to forum administrators. So you, as a “normal” user might not see it, but an administrator of the forum quite well could.
It might not be your IP that they’re tracking, either.
The forum might include information that could be tracked to the same machine or IP in your user profile.
Finally … and many people don’t get this at all … it could be something as simple as your writing style. We each have our own style – including common errors and grammatical nuances – that is fairly consistent when we write. A sharp observer could possibly be looking at posts you’ve made under both ID’s and noticed that they’re written in nearly identical style.
I’ve actually experienced this one at least one mailing list where a member who supposedly left clearly returned by writing using her husband’s membership. Her style was quite obvious, and distinct from her husband’s.
So as you can imagine, there are many possibilities.
The best solution, of course, is not to need to play these games in the first place. But I know that there are sometimes appropriate and valid reasons. I’ve even done it myself.