I’m assuming you’re mostly interested in the killswitch part of the post and have an OpenVPN type VPN provider already (Private Internet Access is the VPN provider I use).
Step 1: Get the IP and MAC of your VPN interface:
The first step is to get the IP and the MAC of the virtual network interface that the VPN creates. One way to do this is to use CMD. On Windows 8/10, click start, type in CMD, and hit enter when it finds a match. Once the command line window pops up, type in “ipconfig -all” without the quotes and it’ll show you all the network devices on your computer. In PIA’s case, the adapter will be called ‘Ethernet for PIA’. Once you have the ip (IPv4 Address) and MAC (in CMD it’s called “Physical Address”), you can go to Comodo to start setting it up.
Step 2: Set up your VPN as a Network Zone in Comodo
In Comodo, go to the Network Zones tab, and create a new Network Zone called “Private Internet Access” (or whatever you want to call it). With that newly created Network Zone selected, go to add and click on “New Address”. In there you’ll want to type in the MAC address you found in CMD and then create another one for the IP address. With Private Internet Access, it assigns a different IP each time you connect, but all the addresses are in the 10.xx.xx.xx range. So In the picture, I have it set to cover every IP address in the 10 range, from 10.0.0.0 to 10.255.255.255. If your VPN provider does the same, it might be best to set up a range as well, as long as it doesn’t conflict with your other address (in my case, my home addresses are all 192.168. addresses, so they’re a different range entirely).
Step 3: Create a Ruleset in Comodo
Next step is to set up the Firewall Ruleset (in Firewall → Rulesets). Create a new one and add the same rules you see in my ruleset. The blocked out part is just the name of my home network. Basically, with IP Out, select your network zone as the source address and set any as the destination address. Vice versa, and make sure the two allow rules are at the top. Then set up the block rules at the bottom.
Step 4: Add applications to be blocked by Comodo if your VPN loses connection
Lastly go to Firewall —> Application rules and add the applications you want to block. Then check/select them and go to edit, and then it will allow you to select the ruleset you just created.
With all of that, you should be done. Any app using that ruleset should only be able to access the internet while your VPN app is connected. If it disconnects then that application should lose all connectivity. If you’re familiar with IPs and all that and know what your local network’s IPs should be, then you can double check to make sure your ruleset is working by using the Comodo Killswitch app. Go to the main Comodo screen, click on “Contained Apps” and then click on “More” and it’ll open up, or install the Comodo Killswitch App. At the top of that app, you can select Network, and then scroll down until you find the application you’re trying to block. Once you find it, you can turn off your VPN and see if it’s able to make any successful connections outside of your network or not. With my ruleset, it should kill all internet access for that app, and also kill any local network connections that app has.
If your app needs local network access, let me know and I can give you a screenshot of my other ruleset. I have an app that needs to access the computer’s loopback using random ports, so I made a ruleset so it could continue to work, but not access the internet if the VPN is turned off.
Hopefully this works for you. These are the settings that worked for me. If you need any help with any of these steps or have questions, let me know.