sudo ufw default deny outgoing
sudo ufw default deny incoming
sudo ufw allow out on tun0 from any to any
sudo ufw allow in on tun0 from any to any
sudo ufw allow out from any to xxx.xxx.xxx <your vpn server address>
sudo ufw enable
sudo ufw status
You won't need a kill switch, because if the VPN connection drops, it's like pulling the plug.
Then, run this command:
For those of us who use PIA - VPN, we can do it via their provided, & brilliant, client GUI that makes it as easy as clicking a switch (literally) to turn on the "VPN Kill switch", among other settings. It is a shame that all of the VPN providers don't make it that easy & effective.
& that sir, Captain Brillo, has been a focus of mine for more years now than I can remember... Personal privacy is not something that I take at all lightly.
I've watched as the government of my country (Oz) has descended into doing so many things, that 20 years ago it would have prosecuted to the fullest extent of the law... itself!
So, I take all of the action that I can to make it as expensive as can be for the tracker to include me in their net.
That said, I've just bought a DJI Mavic Pro 2 drone, & am finally forced to create a G**gle account (with false info' where possible - not that I think it makes much difference when they have your phone number lol) so that I can install the DJI Go4 app (so now the Chinese can track me too! lol) that is required to be on my Android (Can't get it outside of G**gle or Ap*le like you can so many other apps - not that I use more than half a dozen of them anyway - not a phoney). :(
Anyway, we do the best we can, & it is never enough these days - IF you use IT. You really can't win.
We can make it a bit harder (more expensive) for THEM - "all those people that are out there looking after our best interest". But that is really all we can do, as in the end our ultimately ineffective attempts to maintain personal privacy are really only political statements that show up in the spreadsheet statistics of those that are watching & collecting/collating data on their demographics.
I've managed to avoid needing a smartphone, and stayed GAFA free. I use multiple emails, and multiple browsers configured differently. VBox for some things.
I'm also retired and have lots of time, and doing all this is huge fun.
Hide-and-Seek all over again. mwwwwuaha