With the exponential growth in the number of mobile devices, providing Internet access via WiFi in trains is rapidly becoming a necessity. However, providing persistent In-ternet access inside a moving train has many challenges. Cellular network is predominantly used for the backhaul connection to the train. However, high deployment cost of a cellular network and presence of coverage holes in the existing cellular networks of telecom companies may dissuade the railway companies to go for such solutions. In this paper, we propose an SDN based architecture to provide Internet connectivity inside trains. The backhaul connection to the train, in the proposed architecture, is provided via WiFi. Deployment of such an architecture is more cost-efficient than that of a cellular network of the same capacity. Moreover, this architecture can also be used to provide connectivity in the coverage holes of the existing networks of the telecom companies. Through simulation, we show that the architecture can provide high throughput while maintaining per packet delay within reasonable limits inside a train. © 2019 IFIP.