All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
If the Hajj or ‘Umrah pilgrim travels by ship, then his ihram (ritual consecration) is to be started when he is parallel to the miqat (place of assuming ihram). He can seek the help of those who work on the ship in this regard, if they are trustworthy in terms of religion. If he cannot find someone to guide him to this, then he can start his ihram from his country, before the ship sails or shortly after it starts sailing.
Ibn ‘Umar said:
When these two towns were conquered (meaning Kufa and Basra), people said to ‘Umar: “O Commander of the Believers, the Messenger of Allah, sallallaahu ‘alayhi wa sallam, fixed Qarn as the miqat for the people of Najd. It is beyond our way, and it is difficult for us to pass through it.” He said: “Take a place situated parallel to Qarn on your usual way as your miqat.” [Al-Bukhari]
Ibn Qudaamah said in Al-Mughni:
If one passes in way that is between two miqats, then he should strive to start his ihram in a place that is parallel to the miqat that is nearer to his way ... If he does not know the place that is parallel to the miqat closer to his way, then he should be cautious and assume ihram a distance before that of the miqat in order to be certain that he did not pass that the miqat without assuming Ihram.
Allah Knows best.