You could just temporarily turn off the internet. For things like this, you should be using a laptop/desktop instead of a server anyways.
It is time consuming to do this and do it right so I actually already created an extension for it in another ShowHN post: https://news.ycombinator.com/item?id=37469321