Tankers were waiting to dock at the Es Sider and Brega ports, port sources said.
It was not immediately clear whether there was any impact on oil production.
A similar closure this month led to a temporary reduction in production by oil company Waha Oil Co as storage capacity at the Es Sider is limited after some tanks were damaged during clashes last year.
An official at state oil firm NOC declined to comment.