Rail passengers are being warned ahead of the engineering work.
South Western Railway has warned the lines between Winchester and Eastleigh will be closed all day Saturday due to maintenance work and buses will run between the two stations.
An hourly service will run from Eastleigh on Saturday and will make additional stops between Southampton Central and Bournemouth.
READ MORE: Wine worth £150 stolen from Southampton Co-op, police said
The lines between Basingstoke and Southampton Central and also between Eastleigh and Fareham, will also be closed all day Sunday.
In order to minimise the disruption buses will run between Basingstoke and Southampton Central via Eastleigh on Sunday.
Buses will also run between Basingstoke and Fareham via Eastleigh and between Southampton Central and Romsey via Eastleigh.
A revised service will run between Fareham and Portsmouth.