We have studied transport of a two-dimensional electron gas through an energy barrier prepared by local anodic oxidation with an AFM tip. Experimental IV curves are first explained by a simple model in which the built-in potential is of tapered shape. Then we use computer simulations, ensemble Monte Carlo method with molecular dynamics included, to explain the details of the 2D electron transport in the system. The simulations show the influence of the carrier concentration, applied voltage, and barrier width, on the effective barrier height. We show that few ionized donors can influence the 2D electron transport in the system significantly. In a similar way the confinement of 2D electrons in nanometer-sized devices (quantum dots, wires, single-electron transistors) can be reduced?.