Shanghai is connected to Nanjing and Ningbo by two major rail lines:
- Hu-Ning Line: This line connects Shanghai to Nanjing.
- Hu-Hang-Yong Line: This line connects Shanghai to the port of Ningbo in Zhejiang province, passing through Hangzhou along the way.