This paper explores the use of vehicles as mobile gateways to enable large-scale connectivity for the Internet of Things (IoT). The proposed network architecture is referred to as mesh+vehicular and is based on mesh communication between IoT devices and short range communication between repositories located along the roads and vehicular gateways. The main goal of the paper is to propose a system level model of this architecture and to demonstrate its advantages over the conventional mesh+cellular IoT architecture. Using techniques of stochastic geometry, queuing theory, and wireless networking, we derive the capacity of such an architecture in terms of maximum data rate per IoT device that the network can sustain. We show that if the density of IoT devices is sufficiently large and the density of repositories scales with that of IoT devices, then the proposed vehicular+mesh architecture has a capacity scaling that outperforms that of the conventional mesh+cellular architecture.