Programa criado para fazer isso sozinho:
Exemplo:
# umask 0000
# # Create no-network namespace
# unshare -n -- dived /var/run/no_network.socket -d
$ dive /var/run/no_network.socket bash
$ # Now inside unshare. Shell should work well, can start X apps, etc.
$ ping 127.0.0.1
connect: Network is unreachable
$ # actually no network
$ id
$ uid=1000(vi) gid=1000(vi) groups=1000(vi),20(dialout),21(fax),...
$ # dived set up groups for us
$ exit
exit
$ # "undove"
# killall dived