John answers this question in v.7-8:
7 Beloved, I am writing you no new commandment, but an old commandment that you had from the beginning. The old commandment is the word that you have heard. 8 At the same time, it is a new commandment that I am writing to you, which is true in him and in you, because the darkness is passing away and the true light is already shining.
Taken literally, this is somewhat confusing since he seems to be saying that he is both giving new command and not giving a new command. However, this parallels Jesus's words in John 13:
34 A new commandment I give to you, that you love one another: just as I have loved you, you also are to love one another.
Here Jesus is interpreting Lev 19:
18 You shall not take vengeance or bear a grudge against the sons of your own people, but you shall love your neighbor as yourself: I am the LORD. (my emphasis)
In giving a new commandment Jesus is restating and old commandment but in a new way. While the Jews were arguing over who "your neighbor" is, Jesus is clearly stating to his disciples who their neighbor is.
In 1 John 2, John is doing the same thing by prefacing the commandments he gives with the old-new commandment paradox and then giving the commandments:
15 Do not love the world or the things in the world.
24 Let what you heard from the beginning abide in you. If what you heard from the beginning abides in you, then you too will abide in the Son and in the Father.
28 And now, little children, abide in him, so that when he appears we may have confidence and not shrink from him in shame at his coming.
11 For this is the message that you have heard from the beginning, that we should love one another.
Thus, the commandments John is talking about are the commands that Jesus gave which are the commandments God the Father gave.
**Scripture quoted from ESV