it might be a bit offtopic but there is a somewhat easy solution to isolate networking for some applications if needed;
sudo ip netns add lonly
sudo ip netns exec lonly sudo -u $USER -i
this should start an interactive shell session with isolated networking, the shell will only see a separate loopback interface without further ado. anything started like this will share the same isolated network environment but you can add and use as many separate network namespaces as needed...