As you switch from international to domestic, you will have to go through passport control in any case, and nearly certainly through security in any case as well. It’s just a matter of which route you take to get there.
The most straightforward route is to follow the Baggage claim/Exit signs when you land in 2B. You will go through passport control, walk through baggage claim and customs, and arrive landside.
Turn left and walk a few hundred meters through 2D (the distinction between 2B and 2D is quite blurry nowadays), the train station, and you arrive in 2F. Unless you need to check in at this point, you’ll then go through security and on to your gate. Note that there are two security checkpoints for different sets of gates in 2F.
The total distance is around 1.2 km, so depending on how fast you walk, between 10 and 25 minutes just for the walk (not counting going through passport control or security).
There is probably also the possibility to take an airside shuttle (specifically, the blue shuttle). The order of operations may be different (you will probably go through passport control in 2F rather than 2D), there’s less walking, more waiting. The queues at passport control and security may be shorter (or not — I don’t have much experience transferring in CDG).
While if everything goes fine 2.5 hours are more than enough, that doesn’t leave much buffer if anything goes awry (first plane delayed, long queues at passport control or security…). Remember that unless you have a very flexible ticket, if you’re not at the gate on time, you’ll be considered a no-show, your ticket is very likely to be cancelled, including further legs on the same booking, and you would have to book and pay for a new ticket out of your own pocket, at last minute prices, which can be very expensive. Worst case you may even have to stay overnight at your expense.
Note that I took for granted that you would be able to check-in online or on mobile for your second flight. If not, then you need to have gone through check-in before the check-in deadline, which shortens your critical path even more.
Depending on whether you have a passport which allows you to use the e-gates, where you sit on the first flight, how fast you walk, what day of the week and time of the day you fly, whether you have status allowing you to use fast track for passport control and security, this could range from low risk to very risky. I certainly wouldn’t do that on a Friday afternoon at the start of school holidays.
The usual advice is to have at least 4 hours between flights booked separately, but that of course varies depending on your aversion to risk (and the specific consequences for you in terms of cost and delay).