linux restrict process network access

Shell
unshare -n program ...
Source

Also in Shell: