Under the circumstances, moats and walls are a good idea. 7th century tactics to defeat 7th century barbarians. If that doesn't work, one can always hope for locusts or a plague.
It will work even better if they build the canal and then relocate the squatters on the Egyptian side. That way the Egyptians and Hamas have no one to smuggle to.