This question already has an answer here:
- Block network access of a process? 10 answers
I am making a program that scrapes information from some web services. I want to test how my program reacts when it can't reach the web service, like if the web service is down or if the local computer has no internet access. Disconnecting my whole computer from the network every time I want to run a test is far too much work.
Is there a simple way to run a program under Linux with no network access?
A command like this would be awesome:
$ no_networking "ruby my_program.rb"