Open the gate by taking out the gatekeeper, then capture the garrison by defeating Xu Huang. Once the outer gates open, you need to avoid direct confrontation with the officers in the area and get to the drawbridge. When you get there, Zhang Liao will appear and he is slightly tougher than the other officers.
Defeating Zhang Liao will lower the drawbridge and allow your main force to arrive. You now need to go around and capture all of the garrisons on the map, so start with the ones to the south. At one point, a messenger will show up and attempt to call in for reinforcements, but it should cross your path if you go with the southcentral garrison first.
With the southern garrisons under your control, head north and go after the ones there. Once you capture all of them, the gate to Wei's main camp will open. Also, Zhang Liao will appear again, so defeat him first before going after Cao Cao to finish the battle.