Not the nicest solution...
But it would work. Many (but I bet not most) Israelis would hate it because they would have to give up settlements. Still, Israel forcibly cleared the settlements out of Sinai before they gave it back to Egypt, so it can be done. Palestinians would hate it, since Israel could not draw any border on dry land that they would be happy with. Many construction workers would die from terrorist attacks while building the wall. But it would work.
