US President Donald Trump has given Iran 48 hours to allow shipping traffic to resume through the Strait of Hormuz.