The westbound carriageway will be shut between junctions 11 at Fareham and 9 at Whiteley from 9pm on Friday until 6am on Monday, September 27.
The eastbound M27 will then be closed between junctions 9 and 11 from 9pm on Friday, October 1, until 6am on Monday, October 4.
Signed diversions will be in place. Drivers heading westbound should leave the M27 at junction 11 onto the westbound A27, to re-join the M27 at junction 9.
Man dies after dog attack at Hillson Drive recreation ground in Fareham - owner is arrested
Fareham dog attack: Shrine set up in memory of man who died - named locally as Wiggy Symes
Heartfelt tributes paid to Wiggy Symes who died after Fareham dog attack
Seven - including five teenagers - arrested after Lower Drayton Lane burglary in Portsmouth
Thunderstorms yellow weather warning issued over Waterlooville, Fareham and parts of Hampshire by Met Office with chance of 'heavy rain'
Traffic travelling eastbound should leave the M27 at junction 9 and take the third exit at the roundabout onto the A27 towards Fareham. Drivers should continue on the eastbound A27 and re-join the M27 at junction 11.
Congestion is expected, so drivers are advised to plan ahead and leave extra time for their journeys.
All diversions will be fully signed, and closures are subject to change.