—Wireless ad hoc networks are connected to the fixed Internet by means of Internet gateways. Whenever a node within the ad hoc network wishes to communicate with a host in the Internet, it selects a default Internet gateway to relay its traffic from the ad hoc network to the Internet. In this paper, we formulate the problem of selecting the best Internet gateway as a mixed integer linear program minimizing the maximum node utilization in the wireless network. By simulations, we show that the performance that can be achieved by solving this optimization problem is significantly higher than what is achieved by standard gateway selection algorithms based on hop count or gateway load. In particular, these heuristic algorithms fail to adapt to the offered traffic and available capacity in the network.