By means of composite quantum collision models, we study the entanglement dynamics of a bipartite system, i.e., two qubits S
1 and S
2 interacting directly with an intermediate auxiliary qubit S
A, while S
A is in turn coupled to a thermal reservoir. We are concerned with how the intracollisions of the reservoir qubits influence the entanglement dynamics. We show that even if the system is initially in the separated state, their entanglement can be generated due to the interaction between the qubits. In the long-time limit, the steady-state entanglement can be generated depending on the initial state of S
1 and S
2 and the environment temperature. We also study the dynamics of tripartite entanglement of the three qubits S
1, S
2, and S
A when they are initially prepared in the GHZ state and separated state, respectively. For the GHZ initial state, the tripartite entanglement can be maintained for a long time when the collision strength between the environment qubits is sufficiently large.